js在頁面中開啟新的視窗

來源:互聯網
上載者:User

標籤:沒有   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在頁面中開啟新的視窗

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.