Internet explorer not showing

2019-08-28 11:36发布

问题:

I've gone through and seen all the answers on IE and issues, but I believe mine is unique. If not, Sorry.

Im busy building a Vehicle listing website for a friend, and I've had some help from a freelancer who is nowhere to be found now.

IE is not showing my model range when I select a vehicle make on my site.

This is the website View it here!

FF and all other browsers work prefectly. I'll also share some code if needed. Thanks. But Im sure you can see the issue through source code viewer.

Thanks

回答1:

It is a known bug for ie as IE don't support innerHTML property in case of select menus.

So,follow this link http://support.microsoft.com/kb/276228

Try this way instead of innerHTML use outerHTML only you have to also echo <select> tag in getodels.php and also this code is smarter and shorter than yours

function makeModel(str, change)
{var xmlhttp;
    if (str!="")
    {
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            var model = document.getElementById("model");
            model.outerHTML=xmlhttp.responseText;
            if(change) {
            }
        }
    }
    xmlhttp.open("GET","getmodels.php?make="+str,true);
    xmlhttp.send();
    }
}


回答2:

At first glance, it looks like a javascript problem, potentially AJAX related.

Try adding the following if your other IE ajax declaration fails. I have this listed for IE8+ in my projects.

xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");