含有js代码的网页,在IE下正常,在FF浏览器下显示不正常。
document.getElementById("tianqi8_wetherinfo").src="http://tianqi.2345a.com/code/inclu...
document.getElementById("tianqi8_wetherinfo").src ="http://tianqi.2345a.com/code/include/weatherinfo.asp?id="+id;
//alert(id)
var d = new Date();
queryUrl="http://tianqi.2345a.com/code/js/weatherdate/"+id+".js?"+d.getMonth()+d.getDate()+d.getHours();
if (navigator.userAgent.toLowerCase().indexOf('msie')>=0) {
document.getElementById("IP_FORIE").src=queryUrl;
}
else {
var js=document.createElement("script");
js.setAttribute("type", "text/javascript");
js.setAttribute("src", queryUrl);
document.body.insertBefore(js, null);
}
}
function ILData_callback()
{
if (typeof(kuang) != "undefined") { $("kuang").title=weatherinfo["city"];}
if (typeof(city) != "undefined") { $("city").innerHTML=weatherinfo["city"];}
if (typeof(weather1) != "undefined") { $("weather1").innerHTML=weatherinfo["weather1"];}
if (typeof(weather2) != "undefined") { $("weather2").innerHTML=weatherinfo["weather2"];}
if (typeof(weather3) != "undefined") { $("weather3").innerHTML=weatherinfo["weather3"];}
if (typeof(temp1) != "undefined") { $("temp1").innerHTML=weatherinfo["temp1"].replace("~","/");}
if (typeof(temp2) != "undefined") { $("temp2").innerHTML=weatherinfo["temp2"].replace("~","/");}
if (typeof(temp3) != "undefined") { $("temp3").innerHTML=weatherinfo["temp3"].replace("~","/");}
if (typeof(img1) != "undefined") { $("img1").src="http://tianqi.2345a.com/code/icon/go2000/"+weatherinfo["img1"]+".png";}
if (typeof(img2) != "undefined") { $("img2").src="http://tianqi.2345a.com/code/icon/go2000/"+weatherinfo["img3"]+".png";}
if (typeof(img3) != "undefined") { $("img3").src="http://tianqi.2345a.com/code/icon/go2000/"+weatherinfo["img5"]+".png";}
if (typeof(wind1) != "undefined") { $("wind1").innerHTML=weatherinfo["wind1"];}
if (typeof(wind2) != "undefined") { $("wind2").innerHTML=weatherinfo["wind2"];}
if (typeof(wind3) != "undefined") { $("wind3").innerHTML=weatherinfo["wind3"];}
if (typeof(riqi1) != "undefined") { $("riqi1").innerHTML=riqi1;}
if (typeof(riqi2) != "undefined") { $("riqi2").innerHTML=riqi2;}
if (typeof(riqi3) != "undefined") { $("riqi3").innerHTML=riqi3;}
$("weather").style.display="";
$("weather-load").style.display="none";
}
以上是截段,因为这里不能输入太多
具体请看以下地址http://www.601160.com/weather-btcha.html
在IE下显示就正常,在FF下IP及天气都无法正确显示。期待高手解答。 展开
//alert(id)
var d = new Date();
queryUrl="http://tianqi.2345a.com/code/js/weatherdate/"+id+".js?"+d.getMonth()+d.getDate()+d.getHours();
if (navigator.userAgent.toLowerCase().indexOf('msie')>=0) {
document.getElementById("IP_FORIE").src=queryUrl;
}
else {
var js=document.createElement("script");
js.setAttribute("type", "text/javascript");
js.setAttribute("src", queryUrl);
document.body.insertBefore(js, null);
}
}
function ILData_callback()
{
if (typeof(kuang) != "undefined") { $("kuang").title=weatherinfo["city"];}
if (typeof(city) != "undefined") { $("city").innerHTML=weatherinfo["city"];}
if (typeof(weather1) != "undefined") { $("weather1").innerHTML=weatherinfo["weather1"];}
if (typeof(weather2) != "undefined") { $("weather2").innerHTML=weatherinfo["weather2"];}
if (typeof(weather3) != "undefined") { $("weather3").innerHTML=weatherinfo["weather3"];}
if (typeof(temp1) != "undefined") { $("temp1").innerHTML=weatherinfo["temp1"].replace("~","/");}
if (typeof(temp2) != "undefined") { $("temp2").innerHTML=weatherinfo["temp2"].replace("~","/");}
if (typeof(temp3) != "undefined") { $("temp3").innerHTML=weatherinfo["temp3"].replace("~","/");}
if (typeof(img1) != "undefined") { $("img1").src="http://tianqi.2345a.com/code/icon/go2000/"+weatherinfo["img1"]+".png";}
if (typeof(img2) != "undefined") { $("img2").src="http://tianqi.2345a.com/code/icon/go2000/"+weatherinfo["img3"]+".png";}
if (typeof(img3) != "undefined") { $("img3").src="http://tianqi.2345a.com/code/icon/go2000/"+weatherinfo["img5"]+".png";}
if (typeof(wind1) != "undefined") { $("wind1").innerHTML=weatherinfo["wind1"];}
if (typeof(wind2) != "undefined") { $("wind2").innerHTML=weatherinfo["wind2"];}
if (typeof(wind3) != "undefined") { $("wind3").innerHTML=weatherinfo["wind3"];}
if (typeof(riqi1) != "undefined") { $("riqi1").innerHTML=riqi1;}
if (typeof(riqi2) != "undefined") { $("riqi2").innerHTML=riqi2;}
if (typeof(riqi3) != "undefined") { $("riqi3").innerHTML=riqi3;}
$("weather").style.display="";
$("weather-load").style.display="none";
}
以上是截段,因为这里不能输入太多
具体请看以下地址http://www.601160.com/weather-btcha.html
在IE下显示就正常,在FF下IP及天气都无法正确显示。期待高手解答。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询