標籤:沒有 path color nbsp oca close dal pat 需要
一、
建立一個視窗,完全獨立
var tabTitle = "test";var url ="test.action";var icon = ‘icon-add‘;window.parent.addTab(tabTitle, url, icon);
在視窗上懸浮一個視窗,兩視窗在同一個HTML文檔
<div id="test"></div> $(‘#test‘).dialog({title: ‘test‘,width: 570,height: 500,closed: false,cache: false,resizable: true,href:‘test.action‘,modal: true}); .dialog出現過一個問題:<**id="test1" name="test1"**>底層頁面<**id="test2" name="test1"**>dialog載入的視窗都添加combotree,通過ajax載入值,底層選值後,dialog中的下拉式清單中就沒有值了window.parent.reloadTab("重新載入的頁面","需要關閉的頁面");
二、
可以在視窗內建立視窗
1,超連結<a href="http://test.jsp" title="測試">Welcome</a>
等效於js代碼
window.location.href="http://test.jsp"; //在同當前視窗中開啟視窗
2,超連結<a href="http://test.jsp" title="測試" target="_blank">Welcome</a>
等效於js代碼
window.open("http://test.jsp"); //另外建立視窗中開啟視窗
3,在頁面div中載入html(屬性雙引號,在雙引號內嵌單引號) <div id="parent"></div> $("#parent").html("<p>duan</p>")先通過ajax請求jsp,然後返回對應HTML,然後通過html(..)來把返回的html代碼指定載入到指定的位置上
4.在頁面div中載入jsp頁面 $("#parent").load("test.jsp);//有問題?
5.待測試$.post(contextpath+"/auth/conpanyloading",data = $("#seachcName").val(),function(data){$("#conpany_id").html(data);
},"html");
6利用easyui標籤建立視窗(在瀏覽器中建立視窗,easyui視窗)<div id="tabs1" class="easyui-tabs" fit="true" border="false"></div>
function testAddSubPage(title,url){ if ($("#tabs1").tabs(‘exists‘, title)){ $("#tabs1").tabs(‘close‘, title); var content = ‘<iframe scrolling="auto" frameborder="0" src="‘+url+‘" style="width:100%;height:100%;"></iframe>‘; $("#tabs1").tabs(‘add‘,{ title:title, content:content, closable:true }); } else { var content = ‘<iframe scrolling="auto" frameborder="0" src="‘+url+‘" style="width:100%;height:100%;"></iframe>‘; $("#tabs1").tabs(‘add‘,{ title:title, content:content, closable:true }); } }
js在頁面中開啟新的視窗