Script (AJAX or JS) does not work properly in IE8

Posted by Uno Mein Ame on Stack Overflow See other posts from Stack Overflow or by Uno Mein Ame
Published on 2013-11-10T21:03:49Z Indexed on 2013/11/10 21:54 UTC
Read the original article Hit count: 166

I have a js/ajax script at http://worldcitiesdatabase.info/test1/

I just received a complaint that it does not work properly in IE8.

Onchange seems to work, but then the next menu is not populated.

Can you please help me figure it out?

Thanks

Not sure what the problematic part of the code is. Here is my guess:

if (window.XMLHttpRequest) {//  code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp=new XMLHttpRequest();
            } else {//                      code for IE6, IE5
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            newList="";
            xmlhttp.onreadystatechange=function() {
                if (xmlhttp.readyState==4 && xmlhttp.status==200) {
                    newList = xmlhttp.responseText;
                    m1.innerHTML=newList;
                    m1.disabled=false;
                }
                if (menuname=="showCountry")  {
                    var c1=document.getElementById('showRegion');
                    if (c1.options.length==2) {
                        if (c1.options[0].value=='NONE') {
                            c1.remove(0);
                            c1.value='0';
                            reloadmenu(c1);
                        }
                    }
                }
            }
            xmlhttp.open("GET",newFile+".php?q="+menuvalue,true);
            xmlhttp.send();

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about AJAX