国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
怎么在框架窗口中退出
  1. 下面的表格列出了 window 對(duì)象某些屬性的相關(guān)信息。    
  2. 屬性 方法 描述    
  3. opener open opener 屬性?xún)H在使用 window.open 方法打開(kāi)的頁(yè)面中可用。    
  4. parent, top 無(wú) parent 和 top 屬性對(duì) frame 或 iframe 內(nèi)打開(kāi)的窗口可用。這兩個(gè)屬性分別返回立即父窗口和最上層的祖先窗口。    
  5. parent, top open parent 和 top 屬性對(duì)于通過(guò) open 方法打開(kāi)或以對(duì)話(huà)框打開(kāi)并返回到當(dāng)前窗口的窗口可用。    
  6. length 無(wú) 不管窗口是怎么打開(kāi)的,length 屬性總是返回窗口中的框架數(shù)目。    
  7. dialogArguments, dialogHeight, dialogLeft, dialogTop, dialogWidth, returnValue showModalDialog 和 showModelessDialog    
  8.   
  9.   
  10. parent 獲取對(duì)象層次中的父窗口。    
  11.   
  12. top 獲取最頂層的祖先窗口。    
  13.   
  14. ****************************************************************   
  15.  1、直接從框架頁(yè)中退出,并轉(zhuǎn)向到新的窗口   
  16. if (Session["admin"] == null)   
  17.         {   
  18.             Response.Write("<script language=javascript>alert('登陸超時(shí),請(qǐng)重新登陸?。?)</script>");   
  19.             Response.Write("<script language=javascript>top.location.href='../news/manager/login.aspx'</script>");   
  20.         }   
  21.   
  22. 2、如果需要在框架頁(yè)中關(guān)閉當(dāng)前窗口并打開(kāi)新窗口   
  23. 1)先提示關(guān)閉當(dāng)前窗口,并且在確定關(guān)閉當(dāng)前窗口后,打開(kāi)新窗口.   
  24. if (Session["admin"] == null)   
  25.         {   
  26.             Response.Write("<script language=javascript>alert('登陸超時(shí),請(qǐng)重新登陸?。?)</script>");   
  27.             Response.Write("<script>window.parent.close(); window.open('../news/manager/login.aspx');</script>");           
  28.        }   
  29. 同樣的效果:   
  30. if (Session["admin"] == null)   
  31.         {   
  32.             Response.Write("<script language=javascript>alert('登陸超時(shí),請(qǐng)重新登陸!!')</script>");   
  33.             Response.Write("<script>window.opener=null;top.window.close();</script>");   
  34.        }   
  35. 3、在框架中關(guān)閉當(dāng)前窗口,不提示。并且打開(kāi)新窗口   
  36. if (Session["admin"] == null)   
  37.         {   
  38.             Response.Write("<script language=javascript>alert('登陸超時(shí),請(qǐng)重新登陸?。?)</script>");   
  39.             Response.Write("<script>window.open('../news/manager/login.aspx');top.close();</script>");          
  40.          }   
  41.   
  42.   
  43.         if (Session["admin"] == null)   
  44.         {   
  45.             Response.Write("<script language=javascript>alert('登陸超時(shí),請(qǐng)重新登陸??!')</script>");   
  46.             Response.Write("<script language=javascript>parent.location.href='../airquery/Admin-manager/index.asp'</script>");   
  47.   
  48.             Response.Write("<script language=javascript>window.open('../airquery/Admin-manager/index.asp');opener=null;top.close();</script>");   
  49.         }   
  50.   
  51.   
  52. window屬性:   
  53.   
  54. opener 設(shè)置或獲取創(chuàng)建當(dāng)前窗口的窗口的引用。    
  55. self 獲取對(duì)當(dāng)前窗口或框架的引用。    
  56.   
  57. windown方法:   
  58.   
  59. close 關(guān)閉當(dāng)前瀏覽器窗口或 HTML 應(yīng)用程序(HTA)。    
  60. open 打開(kāi)新窗口并裝入給定 URL 的文檔。    
  61.   
  62. 簡(jiǎn)單總結(jié)一下:   
  63.   
  64. 兩句任意選一句都可完成表面上類(lèi)似同樣的效果。   
  65. 但是實(shí)際效果上的差別:   
  66. Response.Write("<script language=javascript>parent.location.href='../airquery/Admin-manager/index.asp'</script>");   
  67. 這里將parent換成top也可以,沒(méi)仔細(xì)研究為什么。自己使用。我在我的框架里top,left.right(三個(gè)框架的right使用無(wú)任何問(wèn)題)   
  68. 這個(gè)是直接轉(zhuǎn)向到新頁(yè)面,但是地址欄上的后退仍然是可以后退的,雖然點(diǎn)后退會(huì)在次返回,可是如我上面的寫(xiě)法,在page_load里,會(huì)再次提示“登陸超時(shí),請(qǐng)重新登陸”確定后再返回。這樣的效果,我不是很滿(mǎn)意,所以得出了下面的使用方法。   
  69. Response.Write("<script language=javascript>window.open('../airquery/Admin-manager/index.asp');opener=null;top.close();</script>");   
  70. 這個(gè)的功能是什么實(shí)際效果呢?很簡(jiǎn)單,打開(kāi)新窗口后,接下來(lái),將原來(lái)的框架窗口關(guān)閉,注意是新窗口,那么當(dāng)然后退按鈕就變成灰色的了??蛻?hù)端自然無(wú)法后退了。這個(gè)效果我比較喜歡。很符合我的原意(比如:不用考慮重復(fù)提交之類(lèi)的問(wèn)題了)。   
  71. 另外我加上opener=null這句,是根據(jù)我的理解加上去的,好象去掉也照樣可以實(shí)現(xiàn)同樣的效果。這里如果將top換parent也同樣可以使用。但是如果換window.close()那提示框又回來(lái)了。以上都是在IE6.0以上版本實(shí)現(xiàn)的效果,別的瀏覽器沒(méi)試驗(yàn)過(guò)。   
  72.   
  73. 小注:我在查看文章的時(shí)候,有人這樣說(shuō),在需要關(guān)閉的窗口<body>里加上onblur="self.close()",然后在用window.close()方法關(guān)閉當(dāng)前窗口也不會(huì)出現(xiàn)提示,但是我在我機(jī)器上怎么試都不行!不得而知為什么!   
  74. 另外又有人說(shuō),如果是用open()方法打開(kāi)的子窗口里,直接用windown.close()或top.close()都可以直接關(guān)閉窗口,我試了,好象這樣的情況下,在body加上onblur="self.close()"后,的確是可以的,但是不加的沒(méi)測(cè)試。實(shí)現(xiàn)我的效果了。做個(gè)簡(jiǎn)單的記錄。   
  75.   
  76.   
  77. 查看window對(duì)象幫助發(fā)現(xiàn)一window方法   
  78.   
  79. returnValue 設(shè)置或獲取從模式對(duì)話(huà)框返回的值。    
  80. setInterval 每經(jīng)過(guò)指定毫秒值后計(jì)算一個(gè)表達(dá)式。    
  81.   
  82.   
  83. Evaluates an expression each time a specified number of milliseconds has elapsed.   
  84.   
  85. Syntax   
  86.   
  87. iTimerID = window.setInterval(vCode, iMilliSeconds [, sLanguage])   
  88. Parameters   
  89.   
  90. vCode Required. Variant that specifies a function pointer or string that indicates the code to be executed when the specified interval has elapsed.    
  91. iMilliSeconds Required. Integer that specifies the number of milliseconds.    
  92. sLanguage Optional. String that specifies any one of the possible values for the LANGUAGE attribute.    
  93.   
  94. Return Value   
  95.   
  96. Integer. Returns an identifier that cancels the timer with the clearInterval method.    
  97.   
  98. Remarks   
  99.   
  100. The setInterval method continuously evaluates the specified expression until the timer is removed with the clearInterval method.    
  101.   
  102. In versions earlier than Microsoft? Internet Explorer 5, the first argument of setInterval must be a string. Evaluation of the string is deferred until the specified interval elapses.   
  103.   
  104. As of Internet Explorer 5, the first argument of setInterval can be passed as a string or as a function pointer.   
  105.   
  106. To pass a function as a string, be sure to suffix the function name with parentheses.   
  107.   
  108. window.setInterval("someFunction()", 5000);   
  109.   
  110. When passing a function pointer, do not include the parentheses.    
  111.   
  112. window.setInterval(someFunction, 5000);   
  113.   
  114. To retrieve a function pointer, use the code shown in the following example:   
  115.   
  116. function callback()   
  117. {   
  118. alert("callback");   
  119. }   
  120. function callback2()   
  121. {   
  122. alert("callback2");   
  123. }   
  124. function chooseCallback(iChoice)   
  125. {   
  126. switch (iChoice)   
  127. {   
  128. case 0:   
  129. return callback;   
  130. case 1:   
  131. return callback2;   
  132. default:   
  133. return "";   
  134. }   
  135. }   
  136. // if i is 0, callback is invoked after 5 seconds   
  137. // if i is 1, callback2 is invoked   
  138. // otherwise, the timer is not set   
  139. window.setInterval(chooseCallback(i), 5000);   
  140.   
  141.   
  142. When you use the setInterval method with Introduction to DHTML Behaviors, the value of vCode should be a function pointer to call a function within the HTML Component (HTC) file or a string to call a function in the primary document.    
  143.   
  144. Example   
  145.   
  146. This example uses the setInterval method to create a Dynamic HTML (DHTML) clock. A variable is assigned to the interval, and can be used as a reference to stop the interval using the clearInterval method.   
  147.   
  148. var oInterval = "";   
  149. function fnStartInterval(){   
  150. oInterval = window.setInterval("fnRecycle()",1000);   
  151. }   
  152. function fnRecycle(){   
  153. // Code to display hours, minutes, and seconds.   
  154. }   
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
JavascriptsetTimeout無(wú)效解決與setInterval的使用
{JS}JavaScript使用Window對(duì)象
一篇文章帶你了解JavaScript時(shí)間
常用的 Javascript 操作匯總 (七
Javascript跨域請(qǐng)求的幾種解決方法
JavaScript 常用方法總結(jié)
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服