JavaScript - Adding Options In Select Widget Not Working In Internet Explorer
Hi All,
I have a javascript function which adds a label and value to a select widget in its parent window. The function is working fine in firefox and chrome without any errors or warnings. But it is not working in internet explorer. Please tell me what the issue is. Thanks in advance for your help. Code: function addToParent( formName, selectName, name, label ) { var parent = window.opener; var selectWidget = parent.document.forms[formName].elements[selectName]; if( selectWidget ) { var length = selectWidget.length; selectWidget[length] = new Option( name, label, false, false ); } } When I tried to debug, internet explorer shows an error in the following line Code: selectWidget[length] = new Option( name, label, false, false ); Is there anything wrong with this statement ?? Similar TutorialsIs there any way to make the select boxes behave in IE the way they do in Firefox? I am setting a fixed width for the select box but IE chops it off. In Firefox it works good. <select width="60" STYLE="width: 60px" name="Category1"> <option value="null">code<?php for($i=0; $i<count($categories); $i++) { echo "<option value=$categories[$i]>$categories[$i] --> $descriptions[$i]"; } ?> </select> 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 I have the following Javascript function that just refuses to work in Internet Explorer (since IE is absolute .......). Can anybody tell me why this wouldn't be working in IE and what I need to do to fix it? I am new to Javascript so don't really have any idea Code: function displaymember() { var d = new Date(); var curr_date = d.getDate(); if (curr_date < 10) curr_date = "0" + curr_date; var curr_month = d.getMonth(); curr_month++; if (curr_month < 10) curr_month = "0" + curr_month; var curr_year = d.getFullYear(); //alert("date="+curr_date+" month="+curr_month+" year="+curr_year); for (i = 0; i < x.length; i++) { membershipstatus = (x[i].getElementsByTagName("membership_status")[0].childNodes[0].nodeValue); name = (x[i].getElementsByTagName("name")[0].childNodes[0].nodeValue); body = (x[i].getElementsByTagName("body_type")[0].childNodes[0].nodeValue); ethnicity = (x[i].getElementsByTagName("ethnicity")[0].childNodes[0].nodeValue); sex = (x[i].getElementsByTagName("sex")[0].childNodes[0].nodeValue); profession = (x[i].getElementsByTagName("profession")[0].childNodes[0].nodeValue); seeking = (x[i].getElementsByTagName("seeking")[0].childNodes[0].nodeValue); date = (x[i].getElementsByTagName("date_joined")[0]); month = (date.getElementsByTagName("month")[0].childNodes[0].nodeValue); year = (date.getElementsByTagName("year")[0].childNodes[0].nodeValue); newa = document.createElement('a'); aIdName = 'my' + i + 'a'; ahref = '#'; aclick = 'show(' + i + ')'; newa.setAttribute('id', aIdName); newa.setAttribute('href', ahref); newa.setAttribute('onclick', aclick); newa.innerHTML = name + " | " + body + " " + ethnicity + " " + sex + " " + profession + " with " + membershipstatus + " membership seeks " + seeking + "<br/>"; if (curr_month == month && curr_year == year) { document.getElementById("member").appendChild(newa); } } } Hi there i have been looking around the internet for a way to resolve the problem i have, admittedly i may well of read the answer several times but being relatively new to JavaScript i am still unclear on much of the terminology. Well basically my problem is that i have a piece of code which wen tested on my mac i was using Firefox, safari, opera etc. all these worked fine when it came to pc testing with internet explorer i was presented with the following errors..... Error Details: 1) Line:32 Char:16 Error: 'getElementsByTagName(...).0.src' is null or not an object Code:0 URL:http://www.janedelacey.co.uk/html/press.html 2) Line:53 Char:41 Error: Object doesnt support this property or method Code:0 URL:http://www.janedelacey.co.uk/html/press.html The url is a clients webpage i dont think this has any effect on the issue. Here is the code for the page if this helps anyone in helping me resolve the issue! Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <LINK REL="SHORTCUT ICON" HREF="../images/favicon.ico"> <link rel="stylesheet" type="text/css" href="../css/layout.css"> <title> Jane De-Lacey - Press </title> <link rel="shortcut icon" href="favicon.ico" > <meta name="description" content="Jane De Lacey is a freelance lingerie designer and manufacturer using the finest silk to create Bras, Briefs, Camisoles, Slip, Dresses and Sleepmasks. The latest collection is called the 'L.A Collection'. "> <meta name="keywords" content="Jane De Lacey, Jane DeLacey, Lingerie, 100% Silk, Bra, Knickers, Briefs, Slips, Camisoles, Dresses, Sleepmasks, Underwear, Sheer Silk, Chemise"> <!--[if lt IE 8]> <style media="screen,projection" type="text/css"> #jgal1 li { filter: alpha(opacity=40); } #jgal1 li.active, #jgal1 li:hover { filter: alpha(opacity=100); } </style> <![endif]--> <script type="text/javascript">document.write("<style type='text/css'> #press_gallery { display: none; } </style>");</script> <!--[if lt IE 6]><style media="screen,projection" type="text/css">#press_gallery { display: block; }</style><![endif]--> <script type="text/javascript"> var gal1 = { init : function() { if (!document.getElementById || !document.createElement || !document.appendChild) return false; if (document.getElementById('press_gallery')) document.getElementById('press_gallery').id = 'jgal1'; var li = document.getElementById('jgal1').getElementsByTagName('li'); li[0].className = 'active'; for (i=0; i<li.length; i++) { var url = li[i].getElementsByTagName('img')[0].src; var url_array = url.split("/"); var j = url_array.length - 1; var thumb_path = "../images/thumbs/"; li[i].style.backgroundImage = 'url(' + thumb_path + url_array[j] + ')'; li[i].style.backgroundRepeat = 'no-repeat'; li[i].title = li[i].getElementsByTagName('img')[0].alt; gal1.addEvent(li[i],'click',function() { var im = document.getElementById('jgal1').getElementsByTagName('li'); for (j=0; j<im.length; j++) { im[j].className = ''; } this.className = 'active'; }); } }, addEvent : function(obj, type, fn) { if (obj.addEventListener) { obj.addEventListener(type, fn, false); } else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent("on"+type, obj[type+fn]); } } } gal1.addEvent(window,'load', function() { gal1.init(); }); </script> </head> <body> <div id="content"> <div id="navcontainer"> <div id="topbanner"> <a href="home.html"><img src="../images/logo1.gif" border="none" width="380" height="50"alt="Home - Jane DeLacey"/></a> </div> <ul id="nav"> <li id="nav-home"><a href="home.html">Home</a></li> <li id="nav-shop"><a href="shop.html">Collections</a></li> <li id="nav-press"><a href="press.html">Press</a></li> <li id="nav-about"><a href="about.html">About Us</a></li> <li id="nav-contact"><a href="contact.html">Contact Us</a></li> </ul> </div> <div id="product"> <div id="product_graf"> <img src="../images/top_lines.gif" alt="Side Graphic" height="300px"> </div> <div id="press"> <div id="press_text"> click logo to view image, click image to enlarge </div> <div id="press_pics"> <ul id="press_gallery"> <li><a href="../images/press/marieclaire.jpg"><img src="../images/press/marieclaire.jpg"width="475px" height="500px" alt="Marie Claire featuring Victoria Beckham" border="none" ></a></li> <li><a href="../images/press/vogue1.jpg"<img src="../images/press/vogue1.jpg"width="350px" height="500px" alt="Vogue" border="none"></a></li> <li><a href="../images/press/elle1.jpg"<img src="../images/press/elle1.jpg"width="350px" height="500px" alt="ELLE" border="none" ></a></li> <li><a href="../images/press/wwd1.jpg"<img src="../images/press/wwd1.jpg"width="350px" height="500px" alt="Womens Wear Daily" border="none" ></a></li> <li><a href="../images/press/brides.jpg"<img src="../images/press/brides.jpg" width="350px" height="500px"alt="Brides" border="none" ></a></li> <li><a href="../images/press/wwd2.jpg"<img src="../images/press/wwd2.jpg" width="350px" height="500px"alt="ELLE" border="none" ></a></li> <li><a href="../images/press/elle2.jpg"<img src="../images/press/elle2.jpg" width="350px" height="500px"alt="ELLE" border="none" ></a></li> <li><a href="../images/press/hg.jpg"<img src="../images/press/hg.jpg" width="350px" height="500px"alt="Homes and Gardens" border="none" ></a></li> <li><a href="../images/press/vogue2.jpg"<img src="../images/press/vogue2.jpg" width="350px" height="500px"alt="Vogue" border="none" ></a></li> <li><a href="../images/press/wwd3.jpg"<img src="../images/press/wwd3.jpg" width="350px" height="500px"alt="Womens Wear Daily" border="none" ></a></li> <li><a href="../images/press/elle3.jpg"<img src="../images/press/elle3.jpg" width="350px" height="500px"alt="ELLE" border="none" ></a></li> <li><a href="../images/press/status1.jpg"<img src="../images/press/status1.jpg" width="350px" height="500px"alt="Status" border="none" ></a></li> <li><a href="../images/press/elle4.jpg"<img src="../images/press/elle4.jpg"width="500px" height="350px" alt="ELLE" border="none" ></a></li> <li><a href="../images/press/wwd4.jpg"<img src="../images/press/wwd4.jpg"width="350px" height="500px" alt="Womens Wear Daily" border="none" ></a></li> <li><a href="../images/press/status2.jpg"<img src="../images/press/status2.jpg" width="350px" height="500px"alt="Status" border="none" ></a></li> <li><a href="../images/press/fashiondaily.jpg"<img src="../images/press/fashiondaily.jpg" width="500px" height="350px"alt="Fashion Daily" border="none" ></a></li> <li><a href="../images/press/eve.jpg"<img src="../images/press/eve.jpg" width="350px" height="500px"alt="Eve" border="none" ></a></li> <li><a href="../images/press/observer.jpg"<img src="../images/press/observer.jpg" width="350px" height="500px"alt="Observer Magazine" border="none" ></a></li> <li><a href="../images/press/telegraph.jpg"<img src="../images/press/telegraph.jpg" width="350px" height="500px"alt="Telegraph" border="none" ></a></li> <li><a href="../images/press/financialtimes.jpg"<img src="../images/press/financialtimes.jpg" width="350px" height="500px"alt="Financial Times" border="none" ></a></li> <li><a href="../images/press/linbuyer.jpg"<img src="../images/press/linbuyer.jpg" width="350px" height="500px"alt="Lingerie Buyer Blog" border="none" ></a></li> <li><a href="../images/press/juice1.jpg"<img src="../images/press/juice1.jpg" width="350px" height="500px"alt="Juice Brighton Magazine" border="none" ></a></li> <li><a href="../images/press/ideal.jpg"<img src="../images/press/ideal.jpg" width="350px" height="500px"alt="Ideal" border="none" ></a></li> <li><a href="../images/press/drapers.jpg"<img src="../images/press/drapers.jpg" width="500px" height="200px"alt="Drapers" border="none" ></a></li> <li><a href="../images/press/juice2.jpg"<img src="../images/press/juice2.jpg" width="500px" height="350px"alt="Juice Brighton Magazine" border="none" ></a></li> </ul> </div> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> </div> <div id="footer"> <ul id="footer_nav"> <li><a href="terms.html">terms & conditions</a></li> <li><a href="delivery.html">delivery</a></li> <li><a href="acknowledge.html">acknowledgments</a></li> <li><a href="contact.html">contact us</a></li> </ul> </div> </div> </div> </body> </html> I know most of this code will not be relevant but i thought adding the whole pages code made more sense? Thank you in advance for any help received! Tom Hi, i have recently just built a simple website and have started to add some added editions one being the lightbox. i am using dreamweaver cs3 and on a mac laptop, so in safari it works brillaint no problems what so ever. but as soon as you load it in internet explorer the light box opens but it displays a 404 error on the first image of every gallery, on every different profile? if anyone would help that would be fantastic http://www.goodeveningladies.co.uk/profiles.co.uk Code: <a href="../images/lrgimages/adam/AdamLrg.jpg" title="Call us today on 07792530515!" rel="sexylightbox[Goodeveningladies.co.uk - Adam]"> <img src="../images/Adam.jpg" alt="" width="450" height="200" align="middle" /> <a href="../images/lrgimages/adam/1.jpg" title="Call us today on 07792530515!" rel="sexylightbox[Goodeveningladies.co.uk - Adam]"> <a href="../images/lrgimages/adam/2.jpg" title="Call us today on 07792530515!" rel="sexylightbox[Goodeveningladies.co.uk - Adam]"> <a href="../images/lrgimages/adam/3.jpg" title="Call us today on 07792530515!" rel="sexylightbox[Goodeveningladies.co.uk - Adam]"> <a href="../images/lrgimages/adam/4.jpg" title="Call us today on 07792530515!" rel="sexylightbox[Goodeveningladies.co.uk - Adam]"> <a href="../images/lrgimages/adam/5.jpg" title="Call us today on 07792530515!" rel="sexylightbox[Goodeveningladies.co.uk - Adam]"> <a href="../images/lrgimages/AdamLrg.jpg" title="Call us today on 07792530515!" rel="sexylightbox[Goodeveningladies.co.uk - Adam]"></a> here is a section of the coding that i use for each image obviously the names have changed and the directories have changed for each profile. any help would be much appreciated. Hi All, This is my first post in this forum. I am relatively new to javascript. Hope I get some guidance here. Also I would like to contribute here when I get little expertise on javascript. I have developed following snippet of code, which is working very well with firefox 6.0. But when it comes to IE 8.0, it just does not work. Quote: <SCRIPT LANGUAGE="JavaScript"> function refreshFrame() { frames['top'].window.location.href = "report.php?parent_id=<? echo $parent_id; ?>"; } </script> </head> <? include('style.php'); include('PHP_functions.php'); print(" <FRAMESET rows='96,100' onLoad=refreshFrame() BORDERCOLOR=blue BORDER=0> <FRAME SRC=blank.html SCROLLING=NO NORESIZE NAME=top> <FRAME SRC=manage.php?view=show_all&parent_id=$parent_id NAME=bottom> </FRAMESET> "); ?> </HTML> In the above script, I am trying to load the frame top after loading frame bottom, as the latter takes more time to load due to some processing involved. Till frame bottom is under processing stage, I display a message "Processing Please wait" which is coming from blank.html. Working under Firefox: It loads blank.html first and displays the message as "processing please wait". Once frame bottom has completed the processing it displays its contents at second half of the webpage. Then finally frame top gets loaded on first half of the web page. This is the expected result. Here URL does not change as the URL remains same as before "http://xyz.com/index.html" Not Working under IE It loads blank.html first and displays the message as "processing please wait". Once frame bottom has completed the processing it displays its contents at second half of the webpage. Then finally frame top gets loaded on whole page instead of first half of the page. Here URL changes to complete new URL as "http://xyz.com/report.php?parent_id" Can anyone please suggest what could be reason for this. Thanks, Vinay i'm having a problem getting something called JavaScript Bitcoin Miner working in IE6+ the error i'm getting is: Line: 8 Char: 6 Error: 'JSON' is undefined Code: 0 URL: http://192.168.0.105/Bitcoin_Miner/index.html does anyone know how i can get this working? thanks. Attached is the source files. BTW... you'll need to instal XAMPP to get this working correctly on your local PC. But if there's a way all of the PHP can be converted to PHP, and Jquery can be cut out of the picture, it would be VERY helpful It works in Google Chrome but not Firefox and Internet Explorer. My computer has blocked Opera and I don't know how to change that. Too much energy to investigate now, I'll do so later. Are there any pros that can tell me why this is happening? I'm assuming GoogleChrome is fixing a syntax error that FF and IE don't. Code: var request; request=false; try { request = new XMLHttpRequest(); } catch (trymicrosoft) { try { request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (othermicrosoft) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (failed) { request = false; } } } function isAlNum(str){ return /^[a-z0-9]+$/i.test(str); } var preUsername; var same; function updatePage() { if (username.value.length>0){ if ( request.responseText.indexOf("0") == -1 ) {userNameErrorBox.innerHTML=username.value + " has already been taken"; usernameSuccessBox.innerHTML="";} else {userNameErrorBox.innerHTML=""; usernameSuccessBox.innerHTML=username.value + " is available";}} } function nameTest() { if (username.value==preUsername) {same=1;} else {same=0;} if (!isAlNum(username.value)) {if (username.value.length>0) {username.value=preUsername;}} else {preUsername=username.value;} if (username.value.length>0 && username.focus && same===0) { userNameErrorBox.innerHTML="";usernameSuccessBox.innerHTML=""; request.abort(); var url = "/unseen/checkIfUserNameExist.php?name=" + username.value; request.open("GET", url, true); request.onreadystatechange = updatePage; request.send(null); } if (username.value.length===0) { userNameErrorBox.innerHTML="";usernameSuccessBox.innerHTML="";preUsername=""; } } I back tracked what i did and it appears that this code Code: var url = "/unseen/checkIfUserNameExist.php?name=" + username.value; request.open("GET", url, true); request.onreadystatechange = updatePage; request.send(null); has the problem. When I set up alerts to see what works and what doesn't, this code seems to be causing the FF and IE to not work, but I can't tell what it is that's causing them to fail. This is javascript that is suppose to check if a name has been taken by another user. I'm working on a fairly large project that I wish to be the new formspring, (size wise) I procrastinated for 2 weeks of my 12 week break and now that I'm just getting started on it I'm running into an ishness load of problems... Very de-motivating I've been having problems getting my select option to change the options of another select option. I'm not much of a javacsript coder, so I'm at a lost. When I select the first option nothing appears in the second option. here's the javascript code: Code: function createOption(OptionText, OptionValue){ var temp = document.captcha_form("option"); temp.innerHTML = OptionText; temp.value = OptionValue; return temp; } function valChange(){ var firstList = document.getElementById("emailaddress"); var secondList = document.getElementById("subject"); while(secondList.hasChildNodes()) secondList.removeChild(secondList.childNodes[0]); switch(firstList.value){ case "1":{ secondList.appendChild(createOption("Report Site Browsing Issue", Report Site Browsing Issues)); secondList.appendChild(createOption("Report Page Errors", Report Page Errors)); secondList.appendChild(createOption("Other", Other)); break; } case "2":{ secondList.appendChild(createOption("Report Unauthorized Game", Report Unauthorized Game)); secondList.appendChild(createOption("Report Spam", Report Spam)); secondList.appendChild(createOption("Report Harassment", Report Harassment)); secondList.appendChild(createOption("Report Illegal Activities", Report Illegal Activities)); secondList.appendChild(createOption("Request Account Removal", Request Account Removal)); break; } // .... default:{ secondList.appendChild(createOption("Please select from the first list", "")); break; } } } window.onload = valChange; this is the form code Code: <div class="mailto_form"> <form method="POST" id="captcha_form" name="captcha_form" action="../includes/mailform.php"> <div style="padding-bottom: 1em;">Choose Recipient: <select name="emailaddress" id="emailaddress" onchange="valChange();"> <option value=""></option> <option value="1">Webmaster</option> <option value="2">Admin</option> </select> </div> <div style="padding-bottom: 1em;">Subject: <br /><select name="subject" id="subject"> </div> <div style="padding-bottom: 1em;">From: <br /><input type="text" name="email" id="email" value=""> </div> <div style="padding-bottom: 1em;">Enter the text contained in the image into the text box: <br /><img src="../includes/captcha.php" /> <br /><input type="text" name="userpass" value=""> </div> <div style="padding-bottom: 1em;">Message: <br /><textarea name="message" id="message" rows="10" cols="60"><?php echo "</tex" . "tarea>"; ?> </div> <div style="padding-bottom: 1em;"><input name="submit" type="submit" value="Submit"> </div> </form> </div> Link to the page http://www.netgamegurus.com/contact/ Hey chaps, hope someone can help with this: I have a PHP form, with a couple of dynamic Select menus, which are populated from two SQL tables: // tbl_main_colour: Code: ID, NAME 1, Red 2, Blue 3, Green // tbl_shade_colour: Code: ID, NAME, FK_MAIN_COLOUR_ID 1, Light Red, 1 2, Dark Red, 1 3, Light Blue, 2 4, Dark Blue, 2 5, Light Green, 3 6, Dark Green, 3 What I'm after is something to filter the second select option, after the first select option has been chosen // Select 1: Code: Red // Select 2: Code: Light Red Dark Red I'm pretty sure this is possible, but not sure how to go about it, any help would be most appreciated. Hello, I am trying to make a simple code that has a selection list (with the choice fruit or veggie). When the user chooses fruit, the second list displays the options apple, orange, banana. When the user changes their choice to veggie, the second select list then contains carrot, corn, potatoes (and the apple, orange, banana disappear). I need some advice on how to do this Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <form name = "form1"> <fieldset> <legend>Fruit or Veggie</legend> <select name = "S1"> <option name = "fruit">Fruit </option> <option name = "veggie">Veggie</option> </select> <select name = "S2" </select> </fieldset> </form> <script language="JavaScript" type="text/javascript"> ??? </script> </body> </html> I have a select box that has ~7000 options, that based on a different dropdown select & input field, gets filtered to 0 - 300 entries. I have another select dropdown that has 13000+ options in total for all the ~7000 entries, but each entry may have 1 to 5 options of these 13000. Is there a way to change the options of the last select dropdown based on what the user chooses in the filtered select box? Currently the idea I'm having is to have the browser load all 13000+ items and filter out the ones that don't apply to the currently selected item, but I'm not sure what kind of lag the user would experience while the browser loads & filters through all these items. Any help would be appreciated. Thanks. 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!! 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 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 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. 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! Sorry fellas, I am a complete noob I am trying to detect if a users browser is Internet Explore Version 9 the subsequently redirect that browser to a new page that is IE 9 specific in my directory. My code does NOT seem to be working. Could any of you kind folks take a look and see the mistake? <script language="JavaScript" type="text/JavaScript"> if(navigator.appName == "Microsoft Internet Explorer"&& navigator.appVersion >=8) { window.location = "SeansWebsite_2012_IE9.html" } <!-- the page that i am starting on is "SeansWebsite_2012.html"--> </script> Hey everyone, this problem has been bothering me for awhile, so I decided to finally stop banging my head against a wall over it and seek out some help. I'm fairly new to web development, but through W3Schools and the almighty Google, I managed to make my way through developing a site for the company that I intern for. The site is designed to query a Microsoft Access database and display the results, so employees can see the results of tests run on another machine in a different area. I did not design the database or queries for this project, but assume that they function as they are supposed to. The way the website works is by displaying a form to the user with a number of check boxes (it varies by page) that each add another parameter to the query. When the query button is clicked, I used the "onclick" action of an HTML button to send the form data to a JavaScript function to be processed. The JavaScript function filters out what I need to send to a php page that runs the query. I send the information from the JavaScript function using an XMLHttpRequest, and replace a line of text in the HTML document with the returned results from the php script. I have tested the completed website in several browsers. It works flawlessly in Chrome, Firefox, and IE9. The problem is, it doesn't work with IE7 or IE8, and even though the company I work for is making a widespread upgrade to Windows 7 from XP within the year, they don't plan on moving beyond IE8. When I load the page in IE8 (I'm running WAMP as my server), I can see that my php scripts work just fine, because some of the fields used to configure the query are generated using php, and they appear as they should. However, when I click the form button that triggers the JavaScript function, nothing happens (IE7 and 8 both report "Error on Page"). I've gone through nearly every Internet Options settings, as far as I know, and I'm fairly certain that every setting related to scripting is enabled, though I've only tried testing the site on IE7 and 8 at work and not at home (where I have unlimited security access). Below is the HTML for the button that triggers the JavaScript function, "displayTable": Code: <input type="button" name="button" value="Show Results" onclick="displayTable(this.form)" /> I'm not sure how easily this problem can be fixed, so if anyone needs to see any other bits of code, I can provide those. But my main question is, does this sound like just some setting in IE7/8 that I don't know about (keeping in mind that, with all the settings the same, the site works fine in IE9), or does IE7/8 simply have some inherent flaw in interpreting JavaScript, and will it be necessary for me to rewrite my code taking some other approach, and if so, what language would be recommended in place of JavaScript in IE7/8? Thanks! |