日期:2014-05-17 浏览次数:20428 次
function GetMenu(act){ $.ajax({ url:"__APP__/Index/GetAcessList", dataType:"json", type:"POST", data:"act="+act, success:function(json){ var html=""; for(var i=0;i<json.rows.length;i++){ html+="<div class='content'>"; html+="<div class='foldingmenucontent'>"; html+="<div class='foldingmenu menu2'><h2><a href='#'>"+json.rows[i].title+"</a></h2></div>"; html+="<div class='foldingnavcontent conten'>"; for(var j=0;j<json.rows[i].items.length;j++){ var url=json.rows[i].items[j].durl; alert(url); html+='<li><a href="#" onclick="addTab('+json.rows[i].items[j].title+','+url+')">'+json.rows[i].items[j].title+'</a></li>'; } html+="</div>"; html+="</div>"; html+="</div>"; } $(".mainleft").html(html); }, error:function(data){ alert(data.responseText); } }); } function addTab(title, url) { if (!$('#MainTab').tabs('exists', title)) { $('#MainTab').tabs('add', { id: url, iconCls:'icon-edit', title: title, closable: true, content: createFrame(url), url: url, fit: true }); } else { $('#MainTab').tabs('select', title); } } function createFrame(url) { var DocWidth = $(document).width(); var DocHight = $(document).height(); var s = "<iframe name='mainFrame' frameborder='0' scrolling='auto' src='" + url + "' style='width:" + (DocWidth - 203) + "px;height:" + (DocHight - 109) + "px;'></iframe>"; return s; }