Internet Explorer未显示<选项>链选择的价值 [英] Internet explorer not showing <option> value on chain select

查看:168
本文介绍了Internet Explorer未显示<选项>链选择的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看过IE和问题的所有答案,但我相信我的独特之处。如果没有,抱歉。



我正忙着为朋友建立一个车辆列表网站,而且我得到了一位现在无处可寻的自由职业者的帮助。 / p>

当我在我的网站上选择车辆制造时,IE没有显示我的车型范围。



这是网站在此处查看



FF和所有其他浏览器都能完美运行。如果需要,我还会分享一些代码。谢谢。但我相信你可以通过源代码查看器看到问题。



谢谢

解决方案

这是IE的已知错误选择菜单时不支持innerHTML属性。



所以,请点击此链接 http://support.microsoft.com/kb/276228



尝试这种方式而不是innerHTML只使用outerHTML还要在getodels.php中回显< select> 标签,此代码也比你的更聪明,更短

  function makeModel(str,change)
{var xmlhttp;
if(str!=)
{
if(window.XMLHttpRequest)
{//代码为IE7 +,Firefox,Chrome,Opera,Safari
xmlhttp = new XMLHttpRequest();
}
else
{// IE6代码,IE5
xmlhttp =新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();
}
}


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

解决方案

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();
    }
}

这篇关于Internet Explorer未显示&lt;选项&gt;链选择的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆