makeshift_theory Posted January 29, 2007 Share Posted January 29, 2007 I have been looking at this for hours and I can't seem to locate the source. I am only receiving this error in Internet Explorer, I am receiving "Type Mismatch" at line 86. However line number is worthless in IE because error handling in IE sucks. It declares the following error is in the text.php page and occurs when I click the "process" button.[code]<html><head><script type="text/javascript" src="chat_app.js"></script><script type="text/javascript">var timeron = false; // timer on indicatorvar closetimer = null ; // timer to control smiliesvar user = "maryj"; // assign user<!--function showsmilies(on){ var smilies = document.getElementById("smilies"); if(on == "on") { smilies.style.display = "block"; }}function startTimer(){ if(timeron == false) { closetimer = setTimeout("hidesmilies()",5000); timeron = true; }}function stopTimer(){ if(timeron == true) { closetimer = clearTimeout(closetimer); timeron = false; }}function hidesmilies(){ var smilies = document.getElementById("smilies"); smilies.style.display = "none";}function checkSelection(type,img) {//IE/Winvar t = type;if(t == 'a'){ var link = prompt("Please enter in url:", "");}var field = document.post.msg;if (document.selection && document.selection.createRange) {field.focus();strSelection = document.selection.createRange();if (strSelection!="") { var tagopen = null, tagclose = null; switch(type) { case "b" : tagopen = "[b]"; tagclose = "[/b]"; break; case "u" : tagopen = "[u]"; tagclose = "[/u]"; break; case "i" : tagopen = "[i]"; tagclose = "[/i]"; break; case "m" : tagopen = "[m]"; tagclose = ""; break; case ">;)>" : tagopen = ">;)>"; tagclose = ""; break; case "o!" : tagopen = "o!"; tagclose = ""; break; case "???" : tagopen = "???"; tagclose = ""; break; case ">>;)" : tagopen = ">>;)"; tagclose = ""; break; case "<:)" : tagopen = "<:)"; tagclose = ""; break; case ">:)" : tagopen = ">:)"; tagclose = ""; break; case ">:)>~" : tagopen = ">:)>~"; tagclose = ""; break; case ">:(" : tagopen = ">:("; tagclose = ""; break; case ":(" : tagopen = ";("; tagclose = ""; break; case ":-)" : tagopen = ":-)"; tagclose = ""; break; case ">:-|>>" : tagopen = ">:-|>>"; tagclose = ""; break; case "a" : tagopen = "[a src="+link+"]"; tagclose = "[/a]"; break; } strSelectionText = tagopen + strSelection.text + tagclose; strSelection.text = strSelectionText; field.focus(); }//Text is not Selected else { alert ("IE: Text is not Selected"); }}//FF and Opera 8+else if (field.selectionStart || field.selectionStart == '0') {//Text is Selected if(field.selectionStart - field.selectionEnd != 0) { var startPos = field.selectionStart; var endPos = field.selectionEnd; var selection = field.value.substr(field.selectionStart, field.selectionEnd - field.selectionStart); var begin = field.value.substring(0,startPos); var end = field.value.substring(endPos,field.value.length); var str = field.value.substring(startPos, endPos); if(t == 'a') var val = begin + "[" + t + " src=" + link + "]" + str + "[/" + t + "]" + end; else var val = begin + "[" + t + "]" + str + "[/" + t + "]" + end; field.value=val; if (field.setSelectionRange) { var start='',end=''; // Declare start and end variables if(t == 'a') start = 6 + link.length, end = 6; // if it's a link else start = 3, end = 4; // if not field.setSelectionRange(startPos,start + endPos + end); field.focus(); } }//Text is not Selectedelse{ if(t == "b" || t == "a" || t == "i" || t == "u") { field.value+="[" + t + "]" + "[/" + t + "]"; var begin = field.value.substr(0, field.selectionStart); field.setSelectionRange(begin.length, (field.value.length - 4)); field.focus(); } else { field.value+=t; }}}}// --></script></head><body onLoad="javascript: getChatText();getUsers();"><br><br><br><br><Br><form action="" method="get" name="post" onSubmit="return false"><input type="button" value="B" onclick="checkSelection('b')"><input type="button" value="I" onclick="checkSelection('i')"><input type="button" value="U" onclick="checkSelection('u')"><input type="button" value="P" onclick="checkSelection('p')"><div id="smilies" onmouseover="showsmilies('on'); stopTimer()" onmouseout="showsmilies('off'); startTimer()" style="border:1px solid #000;width:150px;height:90px;display:none;position:absolute;top:10;left:80px;z-index:1;overflow:auto;background-color:#FFF"><!-- start smilies --><img src="smilies/atomiccannon.gif" border="0" onclick="checkSelection('>;)>');"><img src="smilies/bomb.gif" border="0" onclick="checkSelection('o!');"><img src="smilies/confused.gif" border="0" onclick="checkSelection('???');"><img src="smilies/darkone.gif" border="0" onclick="checkSelection('>>;)');"><img src="smilies/dunce.gif" border="0" onclick="checkSelection('<:)');"><img src="smilies/evil.gif" border="0" onclick="checkSelection('>:)');"><img src="smilies/flamethrower.gif" border="0" onclick="checkSelection('>:)>~');"><img src="smilies/mad.gif" border="0" onclick="checkSelection('>:(');"><img src="smilies/sad.gif" border="0" onclick="checkSelection(':(');"><img src="smilies/smiles.gif" border="0" onclick="checkSelection(':-)');"><img src="smilies/sniper.gif" border="0" onclick="checkSelection('>:-|>>');"></div><input type="button" value="S" onmouseover="showsmilies('on'); stopTimer()" onmouseout="showsmilies('off'); startTimer()"><input type="button" value="Link" onclick="checkSelection('a')"><div id="content" style="float:right;width:500px;height:300px;overflow:auto;background-color:#DCDCDC;border:1px solid #000"></div><br><pre><input type="text" name="msg" id="msg" style="width:300px;height:40px" wrap="hard"></pre><input onClick="sendChatText(0)" type="submit" value="Process Text" name="Process" id="Process"><input type="submit" name="logout" id="logout" onClick="javascript: sendChatText(1)" value="Log Out"></form><div id="chatroomlist" name="chatroomlist" style="border:1px solid #000000;width:200px;height:300px;"><!-- Populates Chat Room List --></div></body></html>[/code] Quote Link to comment Share on other sites More sharing options...
makeshift_theory Posted January 29, 2007 Author Share Posted January 29, 2007 Okay, after doing some research I have located the issue. The issue is a AJAX issue, with IE you have to declare NEW function(this.req.handler)) for some odd reason. Microsoft is just screwy like that I suppose.PS > For those that were interested here is the code:[code] if (navigator.appName=="Microsoft Internet Explorer") sendReq.onreadystatechange = new Function(handleSendChat(logout)); else sendReq.onreadystatechange = handleSendChat(logout); [/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.