下面的代码仅支持Chrome和FF,不支持IE浏览器,是什么原因?应如何改进?求助高手帮忙。<link href="/mall.css" rel="stylesheet" type="text/css" id="contentcss" />
<link href='/theme/css/ui-darkness/jquery-ui-1.8.20.custom.css' rel='stylesheet' type='text/css' id="cartcss" />
<link href='/theme/css/flick/jquery-ui-1.8.20.custom.css' rel='stylesheet' type='text/css' id="ordercss" /><script type="text/javascript" src="/skin/default/js/tabs.js"></script><script src="/theme/js/jquery-1.7.2.min.js"></script>
<script src="/theme/js/jquery-ui-1.8.20.custom.min.js"></script> <script src="/iframe_adaption.js"></script> <script>
$(document).ready(function()
{
var links = document.getElementsByTagName("link");
for(i=1; links[i]; i++)
{
links[i].disabled = true;
}
$('iframe').iframeAutoHeight({debug: true});
$("#cart").click(function()
{
links[2].disabled =true;
links[1].disabled =false;
$('<iframe src="/e/enews/?enews=AddBuycar&classid=10&id=39" width="0" height="0" scrolling="no" frameBorder="0" />').dialog({
resizable: false,
modal: true,
width:253,
height: 144,
overlay: { backgroundColor: "#000", opacity: 0.5 },
buttons:{ "Close": function() { $(this).dialog("close"); } },
close: function(ev, ui) { window.open("/","_blank"); },
}); }); $("#order").click(function() {
links[1].disabled =true;
links[2].disabled =false;
$('<iframe src="/e/enews/?enews=OrderBuycar&classid=10&id=39" width="576" height="448" scrolling="no" frameBorder="0" />').dialog({
resizable: false,
modal: true,
width:811,
height: 505,
overlay: { backgroundColor: "#000", opacity: 0.5 },
buttons:{ "Close": function() { $(this).dialog("close"); } },
}); $('iframe').iframeAutoHeight({debug: true});
}); $("#order2").click(function() {
links[1].disabled =true;
links[2].disabled =false;
$('<iframe src="/e/enews/?enews=OrderBuycar" width="576" height="448" scrolling="no" frameBorder="0" />').dialog({
resizable: false,
modal: true,
width:811,
height: 505,
overlay: { backgroundColor: "#000", opacity: 0.5 },
buttons:{ "Close": function() { $(this).dialog("close"); } },
}); $('iframe').iframeAutoHeight({debug: true});
});
$("#delorder").click(function(){
$('iframe').iframeAutoHeight({debug: true}); });});
</script><div style="position: relative; padding: 0px 0pt 0pt 50px;margin: 0px;height: 70px;"><img id="cart" style="position: relative; left: 20px;cursor:pointer" src="/mall_images/cart.gif"><img id="order" style="position: relative; left: 40px;cursor:pointer" src="/mall_images/order.gif"></div>
<link href='/theme/css/ui-darkness/jquery-ui-1.8.20.custom.css' rel='stylesheet' type='text/css' id="cartcss" />
<link href='/theme/css/flick/jquery-ui-1.8.20.custom.css' rel='stylesheet' type='text/css' id="ordercss" /><script type="text/javascript" src="/skin/default/js/tabs.js"></script><script src="/theme/js/jquery-1.7.2.min.js"></script>
<script src="/theme/js/jquery-ui-1.8.20.custom.min.js"></script> <script src="/iframe_adaption.js"></script> <script>
$(document).ready(function()
{
var links = document.getElementsByTagName("link");
for(i=1; links[i]; i++)
{
links[i].disabled = true;
}
$('iframe').iframeAutoHeight({debug: true});
$("#cart").click(function()
{
links[2].disabled =true;
links[1].disabled =false;
$('<iframe src="/e/enews/?enews=AddBuycar&classid=10&id=39" width="0" height="0" scrolling="no" frameBorder="0" />').dialog({
resizable: false,
modal: true,
width:253,
height: 144,
overlay: { backgroundColor: "#000", opacity: 0.5 },
buttons:{ "Close": function() { $(this).dialog("close"); } },
close: function(ev, ui) { window.open("/","_blank"); },
}); }); $("#order").click(function() {
links[1].disabled =true;
links[2].disabled =false;
$('<iframe src="/e/enews/?enews=OrderBuycar&classid=10&id=39" width="576" height="448" scrolling="no" frameBorder="0" />').dialog({
resizable: false,
modal: true,
width:811,
height: 505,
overlay: { backgroundColor: "#000", opacity: 0.5 },
buttons:{ "Close": function() { $(this).dialog("close"); } },
}); $('iframe').iframeAutoHeight({debug: true});
}); $("#order2").click(function() {
links[1].disabled =true;
links[2].disabled =false;
$('<iframe src="/e/enews/?enews=OrderBuycar" width="576" height="448" scrolling="no" frameBorder="0" />').dialog({
resizable: false,
modal: true,
width:811,
height: 505,
overlay: { backgroundColor: "#000", opacity: 0.5 },
buttons:{ "Close": function() { $(this).dialog("close"); } },
}); $('iframe').iframeAutoHeight({debug: true});
});
$("#delorder").click(function(){
$('iframe').iframeAutoHeight({debug: true}); });});
</script><div style="position: relative; padding: 0px 0pt 0pt 50px;margin: 0px;height: 70px;"><img id="cart" style="position: relative; left: 20px;cursor:pointer" src="/mall_images/cart.gif"><img id="order" style="position: relative; left: 40px;cursor:pointer" src="/mall_images/order.gif"></div>
看行不行,我没时间看,先这样改了试下。如果行,不论什么方法,能达到目的,就行,不一定非得用JQ,只不过,我没时间看而矣,看改了看吧。
{
links[i].disabled = true;
}
循环不加length的么? 这里不知道是我的知识太浅薄 还是错误.
for(i=1; links[i]; i++)
{
links[i].disabled = true;
} 仔细看看 这里我还看糊涂了.. links[i] 拿到的不是一个link么? 怎么直接当循环条件了?