JavaScript - Error:object Expected In Internet Explorer
An error 'Object expected' error occurs when loading the page online in IE.There is no error in any browser when it is in local.I need to show a popup when mouse is moved upwards...it works nice in all browsers offline but when it is made online it is not working properly in IE,when the mouse is moved upward popup shows with an error 'Object expected' and it fails to load that instant.In mozilla and other browsers it works properly.Please help to fix it, its very important for me.
Thanx Similar TutorialsHi guys i am trying to make my form out put inputs to the table below. however when i debug in ie9 it tells me error object expected for Code: <button onclick="document.getElementById('tablename').value= document.getElementById('name').value">Submit</button> how do i properly declare the object? the full code is below (i will obviously have more input fields just working it all out first) thanks david Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> <title> HiQuote </title> <!-- Local JavaScripts --> <script type="text/javascript"> // -------------------------------------------- // the 'program' - the CONTROL LAYER function getElementById(" " ) { button onclick="document.getElementById(" ") } // --------------------------------------------- // The global variables - the PERSISTENCE LAYER (sort of!) var Name; var Number; var button onclick="document.getElementById(" ") // --------------------------------------------- // The processing functions - the LOGIC LAYER // --------------------------------------------- // The input/ output functions - the PRESENTATION LAYER // THIS enhanced presentation layer uses a web page form for input // and output. </script> </head> <body> <form name="form" action=" " > INPUT DATA:<br/><br/> Customer name (text): <input name="dataInputName" type = "text" size="30" /><br/><br/> Phone number (text): <input name="dataInputNumber" type ="text" size="10" /><br /><br /> <button onclick="document.getElementById('tablename').value= document.getElementById('name').value">Submit</button> </form> <table> <tr> <td id="tablename"> </td> </tr> <tr> <td id="tablenumber"> </td> </tr> </table> </body> </html> Hi, I'm trying to get the below code working... But it seems to be throwing an error when the function hitcount(fn) is called... Im trying to call an ASP function within Javascript... Can any one please help with this : Code: -- Javascript code -- <script LANGUAGE="JavaScript1.2" > function checkurl(fn) { str = "http://webhost.in/PNM/Book/<%=gotorpt%>/" + fn; if (str.indexOf ("web//") > 0) { alert("Please Select a Month!"); } else { str2 = "http://webhost.in/PNM/Book/counter.asp?choserpt=Y&whichyrmth=" + str; hitcount(fn); -- Error occurs here : Object Expected self.location.href = str; } return; } </script> --ASP function -- <% function hitcount(fn) set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "..\Hits\hitcounter.mdb" -- Database conn.Mode = 3 set rs = Server.CreateObject("ADODB.Recordset") set SQL = "UPDATE Application_counter SET Application_counter.[Counter] = Application_counter.Counter+1 where pdf='"+fn.substring(0,8)+"';" rs.Open SQL,conn,1,3 document.write(rs(0)) rs.Close() cn.Close() end function %> i keep getting this error in explorer, while on chrome and on Firefox, it is just not working. this is the html table, (the relevant part is bold) Code: <table align="center"> <tr> <td> שם: </td> <td> <input type="text" id="uname" name="txtname" value="שדה חובה" onmouseout="chkfld('uname')" onclick="this.value='';" /> </td>] </tr> <tr> <td> טלפון: </td> <td> <input id="phone" type="text" name="txtphone" /> </td> </tr> <tr> <td> אימייל: </td> <td> <input type="text" id="usermail" name="txtemail" value="שדה חובה" onmouseout="chkfld('usermail')" onclick="this.value='';" /> </td> </tr> <tr> <td> סיבת הפניה: </td> <td> <select id="reason"> <option>סדנאות</option> <option>טיפול</option> <option>הורדת משקל</option> <option>ניקוי רעלים</option> <option>כללי</option> </select> </td> </tr> <tr> <td> פרטים: </td> <td> <textarea id="TextArea1" cols="20" rows="10"></textarea> </td> </tr> <tr> <td align="center"> <input type="submit" value="שלח" /> </td> </tr> </table> and this is the JS: Code: <script type="text/javascript"> function chkfld(id) { if (document.getElementById(id).value == "" || "שדה חובה") { document.getElementById(id).style.backgroundcolor = "yellow"; document.getElementById(id).value == "שדה חובה"; } else { return true; } } </script> The website is CnJ-Tree.atwebpages.com The site works in everything, except, IE. Of course, never fails right. Anyway, the error is with the navigation. I keep getting object expected errors, on pretty much all of my onMouseOver, onMouseOut, and onClick events. Here is the html. Code: <tr> <td background="images/CnJ-Layout_04.png" width="720" height="28" valign="middle" align="center"> <div id="container" class="navigation"> <a href="#" onClick="openPage('home.php');"><div id="home" class="home" align="center" onMouseOver="navOpen('home');" onMouseOut="navClose('home');">Home</div></a> <a href="#" onClick="openPage('contact.php')"><div id="contact" class="contact" align="center" onMouseOver="navOpen('contact')" onMouseOut="navClose('contact')">Contact Us</div></a> <div id="service" class="service" align="center" onMouseOver="mopen('serviceDropDown'); navOpen('service');" onMouseOut="mclosetime(); navClose('service');" style="cursor:pointer">Services</div> <div id="serviceDropDown" class="serviceDropDown" align="center" onMouseOver="mcancelclosetime(); navOpen('service');" onMouseOut="mclosetime(); navClose('service');" style="visibility: hidden"> <div id="tree" style="cursor:pointer" onClick="openPage('tree-removal.php')" onMouseOver="navOpen('tree')" onMouseOut="navClose('tree')">Tree Removal</div> <div id="trimming" style="cursor:pointer" onClick="openPage('tree-removal.php')" onMouseOver="navOpen('trimming')" onMouseOut="navClose('trimming')">Tree Trimming</div> <div id="hauling" style="cursor:pointer" onClick="openPage('tree-removal.php')" onMouseOver="navOpen('hauling')" onMouseOut="navClose('hauling')">Any Hauling</div> </div> <div id="about" class="about" align="center" onMouseOver="navOpen('about')" onMouseOut="navClose('about')">About Us</div> <div id="gallery" class="gallery" align="center" onMouseOver="navOpen('gallery')" onMouseOut="navClose('gallery')">Gallery</div> </div> </td> </tr> And here is the JS for the related areas. Code: <script type="text/javascript"> var xmlhttp window.onload=function(){ var dotspan = document.getElementById('dots'); window.setInterval(function(){ if(dotspan.innerHTML == '...'){ dotspan.innerHTML = '.'; } else{ dotspan.innerHTML += '.'; } }, 200); // Initiate AJAX usage try { xmlhttp = new XMLHttpRequest(); } // Firefox, Opera 8.0+, Safari catch(e){ try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } // Internet Explorer catch(e){ try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } // Internet Explorer catch(e){ alert("Your browser does not support AJAX!"); return false; } } } } function navOpen(page) { document.getElementById(page).style.backgroundImage = "url(images/navi-rollover.png)"; document.getElementById(page).style.color = "#787864"; } function navClose(page) { document.getElementById(page).style.backgroundImage = ""; document.getElementById(page).style.color = "#9b9b80"; } var timeout = 500; var closetimer = 0; var ddmenuitem = 0; // open hidden layer function mopen(id) { // cancel close timer mcancelclosetime(); // close old layer if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; // get new layer and show it ddmenuitem = document.getElementById(id); ddmenuitem.style.visibility = 'visible'; } // close showed layer function mclose() { if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; } // go close timer function mclosetime() { closetimer = window.setTimeout(mclose, timeout); } // cancel close timer function mcancelclosetime() { if(closetimer) { window.clearTimeout(closetimer); closetimer = null; } } // close layer when click-out document.onClick = mclose; window.onload=function(){ // Initiate AJAX usage try { xmlhttp = new XMLHttpRequest(); } // Firefox, Opera 8.0+, Safari catch(e){ try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } // Internet Explorer catch(e){ try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } // Internet Explorer catch(e){ alert("Your browser does not support AJAX!"); return false; } } } } function openPage(id) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url=id; xmlhttp.onreadystatechange=function(){ if(xmlhttp.readyState !=4){ document.getElementById("main").innerHTML=("<center><img src='http://upload.wikimedia.org/wikipedia/commons/4/42/Loading.gif'></center>"); } else{ document.getElementById("main").innerHTML=xmlhttp.responseText; } } ; xmlhttp.open("GET",url,true); xmlhttp.send(null); function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } } </script> Please help, I'm getting this error, Object expected, Code: 0 in Internet Explorer (not in Firefox, though). Here is the link to the page: http://www.uatparts.com/miva/merchan...Category_Code= I'm worried that my customers might shy away and not buy from me when they see this error. What do I need to do in order to stop this error from appearing? Note: I tried including the code in this thread but it was too long, the forum wouldn't let me. I am using HAPedit for HTML/Javascript and it used to work alright by clicking Display -> Browse with -> Default Browser(Internet Explorer). But since last one or two days it gives the following error "The page cannot be displayed" and the following is shown in the URL bar http://localhost/helloworld.html 2. But, however, if I navigate to the file by using File -> Open of the IE, the result is shown correctly. 3. What has gone wrong?? Hi, I have dozens of pages on my website which have just started showing an 'Error on page' message at the bottom left of Internet Explorer 8.0. These messages do not appear when using Mozilla Firefox. My website is www.lakesandcumbria.com and an example of a page showing the error message is http://www.lakesandcumbria.com/view/walks/ambleside.htm which contains a javascript drop down list. All other pages using this type of drop down list are showing the same error message (dozens of them). I have ensured that 'Script debugging' is disabled in Internet Explorer but this hasn't helped! Help - How can I stop this happening in Internet Explorer 8.0 please? Hi, Could I use javascript code to stop Internet Explorer script error messages? Bob Kuspe Hi, I'm using HTA with iframes contains external web pages, lot of pages (external - not mine) contains errors and while running 'script error' pops. If running the same pages in IE there are only error notice in the bottom left side of the browser. Can I do something to ignore those script error popups in my HTA? (I'm using also Javascript for my HTA) Could I use javascript code to stop Internet Explorer script error messages? Regards Bob This is a common issue, however, I haven't found anything ( yet ) that points out a solution that I can find in my code. As usual, this site works with every single browser known to man ...........except for any version of IE. I have tried using IE's devel tools to no avail ....though I'm a complete newb, so that isn't saying much. Code??? Here's the section IE complains about: Code: function display(str) { var nodeList = xmlDoc.getElementsByTagName("item"); var cnt = 0; var list = "<hr />"; for(var i=0; i< nodeList.length; i++) { cnt++; // Get vars from XML title = nodeList[i].getElementsByTagName("title")[0].childNodes[0].nodeValue; author = nodeList[i].getElementsByTagName("author")[0].childNodes[0].nodeValue; pubDate = nodeList[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue; call = nodeList[i].getElementsByTagName("call")[0].childNodes[0].nodeValue; cover = nodeList[i].getElementsByTagName("cover")[0].childNodes[0].nodeValue; link = nodeList[i].getElementsByTagName("link")[0].childNodes[0].nodeValue; summary = nodeList[i].getElementsByTagName("summary")[0].childNodes[0].nodeValue; style = nodeList[i].getElementsByTagName("class")[0].childNodes[0].nodeValue; page = nodeList[i].getElementsByTagName("page")[0].childNodes[0].nodeValue; category = nodeList[i].getElementsByTagName("category")[0].childNodes[0].nodeValue; I opened this with Firebug and I see nothing of interest. Specifically, IE complains about line 86: Code: summary = nodeList[i].getElementsByTagName("summary")[0].childNodes[0].nodeValue; Thanks for reading ~ Bub **** UPDATE ***** Well ...it looks like I can't have null values in any elements ( in the xml document ). How do you experts satisfy this requirement in an elegant fashion. Since there is no data for certain elements, I'm looking for a reasonable failover solution. Empty quotes? ..... still experimenting. A script produces the xml file from a database so some elements do not have data for certain child elements. **** UPDATE 2 ***** Using the Unicode non-breaking space in the xml file for empty child elements. Works, but if you have a cooler solution, let me know. Thanks! Hi, I'm trying to use a form which is existent on one of my sites and try re-creating a similar form on another site for the exact same purpose. Here is the URL for the form on our website Cast Iron Cookware Depot. I have everything duplicated but running into form validation errors. Right now without event entering any data into the form and also the verification code the form still gets submitted but ofcourse runs into "object expected" error at onsubmit="return validate(this);"> by IE Debugger. Below is the total code and would appreciate if any of you gurus point out where the mistake is and also why the exact same code is working on one site is not working on this site. Thanks much in advance. Please help me! ------------------------------------------------------------------------ Code: <style> .TableBG { background-color: #83a338; color: #ffffff; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } .no { font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #333333; width: 35px; text-align:right; } input, textarea {border: 1px inset #cccccc; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 12px;} .input01 {width: 150px;} .input02 {width: 250px;} .button { background-color: #83a338; color: #000000; border: 1px outset #83a338; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12px; } </style><br /> <br /> <table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF" class="TableBG"> <tr> <td bgcolor="#FFFFFF"> <FORM name="form1" method="POST" action="http://s.p8.hostingprod.com/@castironcookwaredepot.com/php/tellafriend.php" onsubmit="return validate(this);"> <FORM name="form1" method="POST" action="http://s.p4.hostingprod.com/@bestsafetyapparel.com/php/tellafriend.php" onsubmit="return validate(this);"> <table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td class="TableBG"> </td> <td class="TableBG"><strong>Your Name: </strong></td> <td class="TableBG"><strong>Your Email: </strong></td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td> </td> <td> <input type="text" name="sName" class="input01" style="font-weight: bold;" /> </td> <td> <input type="text" name="sEmail" class="input02" size="40" style="font-weight: bold;" /> </td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td width="4%" class="TableBG"> </td> <td width="36%" class="TableBG"> Your Friend's Name :</td> <td width="60%" class="TableBG">Your Friend's Email:</td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td class="no"><strong>1.</strong></td> <td> <input type="text" name="name1" class="input01" /> </td> <td> <input type="text" name="email1" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>2.</strong></td> <td> <input type="text" name="name2" class="input01" /> </td> <td> <input type="text" name="email2" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>3.</strong></td> <td> <input type="text" name="name3" class="input01" /> </td> <td> <input type="text" name="email3" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>4.</strong></td> <td> <input type="text" name="name4" class="input01" /> </td> <td> <input type="text" name="email4" class="input02" size="40" /> </td> </tr> <tr> <td class="no"><strong>5.</strong></td> <td> <input type="text" name="name5" class="input01" /> </td> <td> <input type="text" name="email5" class="input02" size="40" /> </td> </tr> <tr> <td class="TableBG"> </td> <td colspan="2" class="TableBG">Your Message </td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td colspan="3" align="center"> <textarea name="comments" cols="65" rows="5" id="comments" style="width: 420px;"></textarea> </td> </tr> <tr> <td class="TableBG"> </td> <td colspan="3" class="TableBG">Enter Verification Code</td> </tr> <tr> <td colspan="3" height="5"></td> </tr> <tr> <td colspan="3" align="center" valign="absmiddle"><img src="http://s.p8.hostingprod.com/@castironcookwaredepot.com/php/captcha.php" align="absmiddle"> <input type="text" name="vercode" value="Enter Verification Code" onFocus="if(this.value=='Enter Verification Code') this.value='';" onBlur="if(this.value=='') this.value='Enter Verification Code';" size="25"/></td> </tr> <tr> <td colspan="3" align="center"> <input type="submit" name="Submit" value=" Send Email " class="button" /> </td> </tr> </table> </form> </td> </tr> </table> <script> function validate(frm) { name = frm.sName; email = frm.sEmail; name1=frm.name1; email1=frm.email1; err_flag = 0; if (name.value == "" || !removeSpaces(name.value)) { alert ("Please enter proper Name!"); name.value=""; name.focus(); return false; } else if (email.value == "" || !validate_email(email.value)) { alert ("Please enter proper Email!"); email.value=""; email.focus(); return false; } else if (name1.value == "" || !removeSpaces(name1.value)) { alert ("Please enter proper Friend\'s Name!"); name1.value=""; name1.focus(); return false; } else if (email1.value == "" || !validate_email(email1.value)) { alert ("Please enter proper Friend\'s Email!"); email1.value=""; email1.focus(); return false; } } function validate_email(e) { var str=e; var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i if (!filter.test(str)) return false; else return true; } function removeSpaces(string) { var tstring = ""; string = '' + string; splitstring = string.split(" "); for(i = 0; i < splitstring.length; i++) tstring += splitstring[i]; return tstring; } </script> <br /> <br /> Regards Learner I have javascript code in my site. It works in FireFox but doesn't work in IE. The page is http://omidpand.ir/search.html First select something from first combobox when u open second combobox the javascript code should change latin characters with persian one, but it doesn't do it. Hi there - I was wondering if anyone out there could help me I'm redoing my site from many years ago - www.industrialarts.co.uk It contains a "Conveyor" - to which I've always wanted to add a "Lightbox" effect. Well - the good news is that I've managed to get a test page up and running and it's doing exactly what I want it to in Firefox, Chrome, Opera and in Safari However .. in Internet Explorer 8 .. it ain't good. The scripts on the page seem not to work at all. (In Internet Explorer 7, it's worse as the formatting is haywire too - but I'll try to fix one thing at a time) http://www.industrialarts.co.uk/test/chairs/chairs.html So - if anybody could be good enough to take a look at my test page and offer any suggestions for getting it running on Internet Explorer too .. or just where to look for answers - I'd be massively grateful My apologies also as I'm a dabbler with this stuff (normally a woodworker) Cheers, Jol Hi There, Can anyone explain why the following XMLHttpRequest.open call fails on IE browsers, but works fine in Firefox and Chrome? Code: <html> <head> </head> <script type="text/javascript"> if( window.XMLHttpRequest ) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET","test.xml",false); // I show an "access is denied error in IE" xhttp.send(""); document.write( xhttp.responseXML.getElementsByTagName("simple")[0].childNodes[0].nodeValue ); </script> <body> </body> </html> The "text.xml" file resides in the same location (local HDD folder on the pc this is running on) as the html page. And the contents of "test.xml" are shown below: Code: <simple> Hello </simple> Obviously its just a very simple example that should just display "Hello" when loaded, but it fails to work in IE. i'm looking for a function to check for the browser version and NOT run a script if the user is using internet explorer 7 or less something like <!--[if gte IE 7]> alert(internet explorer 6 sucks) <!--[else]> alert(internet explorer 7 or greater is better but it still sucks) <![endif]--> and if i just use "lte IE 7" instead of gte IE 7 it will exclude firefox... so that's why i prefer to use a "else" statement.... instead you got something better to suggest thanks!! Hello, I'm new to Javascript programming. I have designed a Javascript to carry information from one page to another. It works fine in firefox but does not work in internet explorer. Is there some coding that needs to be specified for my script to work in ie? Thanks when this page is viewed in IE (8), IE tells me there's an error on the page. Quote: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Win64; x64; Trident/4.0) Timestamp: Tue, 17 May 2011 14:29:31 UTC Message: Invalid argument. Line: 7 Char: 17603 Code: 0 URI: http://cpanel4.frontline.net/~ggarch...cufon/cufon.js Here's what that Javascript file looks like: http://pastebin.com/T2vgugm2 I honestly know very little about Javascript. I installed a wordpress theme that already contained this bit of Javascript so please be patient with me on this one. please advise. thanks in advance! hey just wondering if anyone could help me with a problem im having with this menu for a website i got a chained menu javascript downloaded and all the data entered for it it will work in firefox but wont in internet explorer and i just dont understand why http://www.jomcfall97.talktalk.net/index1.html its the menu on the right hand side this is the error message Message: Object doesn't support this property or method Line: 247 Char: 5 Code: 0 URI: http://www.jomcfall97.talktalk.net/chainedmenu.js Here are lines 244 - 248 function initListGroup(n) { var _content=cs_findContent(n), count=0; if (_content!=null) { content=new cs_contentOBJ("cs_"+n,_content.menu); cs_content[cs_content.length]=content; and heres the full chainedmenu.js Code: var _disable_empty_list=false; var _hide_empty_list=false; var onclickaction="alert" function goListGroup(){ for (i=arguments.length-1;i>=0; i--){ if (arguments[i].selectedIndex!=-1){ var selectedOptionvalue=arguments[i].options[arguments[i].selectedIndex].value if (selectedOptionvalue!=""){ if (onclickaction=="alert") alert(selectedOptionvalue) else if (newwindow==1) window.open(selectedOptionvalue) else window.location=selectedOptionvalue break } } } } if (typeof(disable_empty_list)=="undefined") { disable_empty_list=_disable_empty_list; } if (typeof(hide_empty_list)=="undefined") { hide_empty_list=_hide_empty_list; } var cs_goodContent=true, cs_M="M", cs_L="L", cs_curTop=null, cs_curSub=null; function cs_findOBJ(obj,n) { for (var i=0; i<obj.length; i++) { if (obj[i].name==n) { return obj[i]; } } return null; } function cs_findContent(n) { return cs_findOBJ(cs_content,n); } function cs_findM(m,n) { if (m.name==n) { return m; } var sm=null; for (var i=0; i<m.items.length; i++) { if (m.items[i].type==cs_M) { sm=cs_findM(m.items[i],n); if (sm!=null) { break; } } } return sm; } function cs_findMenu(n) { return (cs_curSub!=null && cs_curSub.name==n)?cs_curSub:cs_findM(cs_curTop,n); } function cs_contentOBJ(n,obj){ this.name=n; this.menu=obj; this.lists=new Array(); this.cookie=""; }; cs_content=new Array(); function cs_topmenuOBJ(tm) { this.name=tm; this.items=new Array(); this.df=0; this.addM=cs_addM; this.addL=cs_addL; } function cs_submenuOBJ(dis,link,sub) { this.name=sub; this.type=cs_M; this.dis=dis; this.link=link; this.df=0; var x=cs_findMenu(sub); this.items=x==null?new Array():x.items; this.addM=cs_addM; this.addL=cs_addL; } function cs_linkOBJ(dis,link) { this.type=cs_L; this.dis=dis; this.link=link; } function cs_addM(dis,link,sub) { this.items[this.items.length]=new cs_submenuOBJ(dis,link,sub); } function cs_addL(dis,link) { this.items[this.items.length]=new cs_linkOBJ(dis,link); } function cs_showMsg(msg) { window.status=msg; } function cs_badContent(n) { cs_goodContent=false; cs_showMsg("["+n+"] Not Found."); } function cs_optionOBJ(text,value) { this.text=text; this.value=value; } function cs_emptyList(list) { for (var i=list.options.length-1; i>=0; i--) { list.options[i]=null; } } function cs_refreshList(list,opt,df) { cs_emptyList(list); for (var i=0; i<opt.length; i++) { list.options[i]=new Option(opt[i].text, opt[i].value); } if (opt.length>0) { list.selectedIndex=df; } } function cs_getOptions(menu) { var opt=new Array(); for (var i=0; i<menu.items.length; i++) { opt[i]=new cs_optionOBJ(menu.items[i].dis, menu.items[i].link); } return opt; } function cs_updateListGroup(content,idx,sidx,mode) { var i=0, curItem=null, menu=content.menu; while (i<idx) { menu=menu.items[content.lists[i++].selectedIndex]; } if (menu.items[sidx].type==cs_M && idx<content.lists.length-1) { var df=cs_getIdx(mode,content.cookie,idx+1,menu.items[sidx].df); cs_refreshList(content.lists[idx+1], cs_getOptions(menu.items[sidx]), df); if (content.cookie) { cs_setCookie(content.cookie+"_"+(idx+1),df); } if (idx+1<content.lists.length) { if (disable_empty_list) { content.lists[idx+1].disabled=false; } if (hide_empty_list) { content.lists[idx+1].style.display=""; } cs_updateListGroup(content,idx+1,df,mode); } } else { for (var s=idx+1; s<content.lists.length; s++) { cs_emptyList(content.lists[s]); if (disable_empty_list) { content.lists[s].disabled=true; } if (hide_empty_list) { content.lists[s].style.display="none"; } if (content.cookie) { cs_setCookie(content.cookie+"_"+s,""); } } } } function cs_initListGroup(content,mode) { var df=cs_getIdx(mode,content.cookie,0,content.menu.df); cs_refreshList(content.lists[0], cs_getOptions(content.menu), df); if (content.cookie) { cs_setCookie(content.cookie+"_"+0,df); } cs_updateListGroup(content,0,df,mode); } function cs_updateList() { var content=this.content; for (var i=0; i<content.lists.length; i++) { if (content.lists[i]==this) { if (content.cookie) { cs_setCookie(content.cookie+"_"+i,this.selectedIndex); } if (i<content.lists.length-1) { cs_updateListGroup(content,i,this.selectedIndex,""); } } } } function cs_getIdx(mode,name,idx,df) { if (mode) { var cs_idx=cs_getCookie(name+"_"+idx); if (cs_idx!="") { df=parseInt(cs_idx); } } return df; } function _setCookie(name, value) { document.cookie=name+"="+value; } function cs_setCookie(name, value) { setTimeout("_setCookie('"+name+"','"+value+"')",0); } function cs_getCookie(name) { var cookieRE=new RegExp(name+"=([^;]+)"); if (document.cookie.search(cookieRE)!=-1) { return RegExp.$1; } else { return ""; } } // ---- function addListGroup(n,tm) { if (cs_goodContent) { cs_curTop=new cs_topmenuOBJ(tm); cs_curSub=null; var c=cs_findContent(n); if (c==null) { cs_content[cs_content.length]=new cs_contentOBJ(n,cs_curTop); } else { delete(c.menu); c.menu=cs_curTop; } } } function addList(n,dis,link,sub,df) { if (cs_goodContent) { cs_curSub=cs_findMenu(n); if (cs_curSub!=null) { cs_curSub.addM(dis,link||"",sub); if (typeof(df)!="undefined") { cs_curSub.df=cs_curSub.items.length-1; } } else { cs_badContent(n); } } } function addOption(n,dis,link,df) { if (cs_goodContent) { cs_curSub=cs_findMenu(n); if (cs_curSub!=null) { cs_curSub.addL(dis,link||""); if (typeof(df)!="undefined") { cs_curSub.df=cs_curSub.items.length-1; } } else { cs_badContent(n); } } } function initListGroup(n) { var _content=cs_findContent(n), count=0; if (_content!=null) { content=new cs_contentOBJ("cs_"+n,_content.menu); cs_content[cs_content.length]=content; for (var i=1; i<initListGroup.arguments.length; i++) { if (typeof(arguments[i])=="object" && arguments[i].tagName && arguments[i].tagName=="SELECT") { content.lists[count]=arguments[i]; arguments[i].onchange=cs_updateList; arguments[i].content=content; arguments[i].idx=count++; } } if (content.lists.length>0) { cs_initListGroup(content,content.cookie); } } } function resetListGroup(n) { var content=cs_findContent("cs_"+n); if (content!=null && content.lists.length>0) { cs_initListGroup(content,""); } } any help appreciated as ive just come to a standstill over this thanks Hello, I have a xmlHttpRequest that was working in Internet explore 6,7 and now is broken in the new Internet explore 8. Can anyone help me pinpoint the problem here? The Error console says this. Invalid procedure call or argument: Code: req.base_open('get', ginf.host + '/includes/process.php?action=jstest&' + failures, true); Screen Captu http://i31.tinypic.com/2v81rg6.jpg This works in Firefox and the older Internet explorers. So I"m not sure what Microsoft did with Internet Exploder 8. Is there syntax error or something with it that the other browser ignored? What is wrong with it? This is the full javascript file if you like to look. http://pastebin.ca/1515445 hi everyone, I hope you can help me understand why my Javascript menu is different on Chrome browser. It is fine on Internet Explorer. Please see images. Internet Explorer Google Chrome I look forward to hearing from you. Ravi |