现在的位置: 首页 > 综合 > 正文

easyui tabs href请求 IE浏览器请求发送2次 火狐正常

2018年02月11日 ⁄ 综合 ⁄ 共 831字 ⁄ 字号 评论关闭

$('#tabs').tabs('add',{
   title:subtitle,
   content:createFrame(url),
   closable:true,
   width:$('#mainPanle').width()-10,
   height:$('#mainPanle').height()-26
  });

function createFrame(url)
{
 alert('create');
 var s = '<iframe name="mainFrame" scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';
 return s;
}

在IE中会发送两次请求 到后台;

是1.3.1版本的bug

$("#tabs").tabs("add", {
    title : subtitle,
    closable : true,
    selected : true,
    cache : true,
    width:$('#mainPanle').width()-10,
   height:$('#mainPanle').height()-26
        });
             var str = '<iframe name="mainFrame" scrolling="auto" frameborder="0"  src="'+url+'"></iframe>'; 

           var index = $("#tabs").tabs("getTabIndex", $("#tabs").tabs("getTab", subtitle));

           alert(str);
          $("#tabs").find(".tabs-panels .panel:eq("+ index +") div").html(str);

先创建一个空的panel 再填充就好

抱歉!评论已关闭.