[求助jQ高人]这个脚本为何不支持IE浏览器?应如何改进?

tehon 2012-07-30 06:10:43
下面的代码仅支持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>
...全文
176 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
tehon 2012-07-31
  • 打赏
  • 举报
回复
没人帮忙吗?
cm_boy 2012-07-30
  • 打赏
  • 举报
回复
<img id="cart" onclick="javascript:alert('dd')" style="position: relative; left: 20px;cursor:pointer" src="/mall_images/cart.gif"> 先屏蔽掉上面的代码。这样改了试下,看有没有用。如果有用。继续改:onclick="show()" function show(){//把上面的jq的点击代码放到这里面}
看行不行,我没时间看,先这样改了试下。如果行,不论什么方法,能达到目的,就行,不一定非得用JQ,只不过,我没时间看而矣,看改了看吧。
tehon 2012-07-30
  • 打赏
  • 举报
回复
补充:在IE下对#cart和#order进行点击毫无反应。
小辛、 2012-07-30
  • 打赏
  • 举报
回复
额~
for(i=1; links[i]; i++)
{
links[i].disabled = true;
} 仔细看看 这里我还看糊涂了.. links[i] 拿到的不是一个link么? 怎么直接当循环条件了?
小辛、 2012-07-30
  • 打赏
  • 举报
回复
for(i=1; links[i]; i++)
{
links[i].disabled = true;
}


循环不加length的么? 这里不知道是我的知识太浅薄 还是错误.
tehon 2012-07-30
  • 打赏
  • 举报
回复
onclick弹窗可执行,但是onclick执行我那段脚本还是不行。可能是脚本本身的问题所致。

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧