_javascript tips on how to intercept a page

Source: Internet
Author: User
    1. Ie

     

2. TT

3. Maxthon

Chrome, the Firefox default installation is no page interception, there are some corresponding plug-ins

The test cannot be tested locally, and the page is placed on the HTTP server. &NBSP
1. IE
Page blocking is set to high and cannot be opened on a new page in any way.
Intercept set to, window.open, write directly on the page, new a click, and form submit can open the page, timeout can not open the page. The
block is set to low and can be opened in several ways.
IE6 will be added after the URL after the Submit method? Like http://www.baidu.com/?
2. Maxthon
does not inherit the blocking settings of IE.
Maxthon Support A certain time timeout open, now testing is probably 850 MS, the above several ways in Timeour more than 850 can not open the page.
3. Chrome
Chrome does not support timeout open in a way that is consistent with IE.
4. TT
TT Custom screen mode does not open a new page with a script.
5. Firefox
Firefox default mode does not intercept, the above can be opened.
Code

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <meta http-equiv=" Content-type "content=" text/html; charset=gb2312 "/> <title>title</title> <style type=" Text/css "> a {display:block; margin:10px 0; border:2px solid #555; width:500px; } </style> <script type= "Text/javascript" >//Chrome, Maxthon do not intercept IE interception level ' in ' Will intercept function test0 () {Windo W.open (' http://www.baidu.com '); function test_10 () {settimeout (function () {window.open (' http://www.baidu.com '); }, 10); function test_local_100 () {settimeout (function () {window.open (' http://' + location.host); }, 100); function test_local () {window.open (' http://' + location.host); //Maxthon not intercept IE interception level ' in ' Will intercept function test () {settimeout (function () {window.open (' http://www.baidu.com '); }, 500); }//Maxthon does not intercept IEInterception level ' in ' Will intercept function test1 () {settimeout (function () {window.open (' http://www.baidu.com '); }, 850); //Maxthon intercept IE interception level ' in ' Will intercept function test2 () {settimeout (function () {window.open (' http://www.baidu.com '); }, 900); //Maxthon intercept IE interception level ' in ' Will intercept function test3 () {settimeout (function () {window.open (' http://www.baidu.com '); }, 1000); }//above several under the Chrome block////Maxthon not intercept IE interception level ' high ' will intercept, Firefox, Chrome does not support function test4 () {var a = Document.creat Eelement (' a '); A.href = "http://www.baidu.com/"; A.target= "_blank"; Document.body.appendChild (a); A.click (); function Test_ope () {var a = document.getElementsByTagName (' a '); for (var i = 0, len=10000 i < Len i++) {for (var j = 0, Len=a.length J < Len; j +) {1}} window.open (' Htt P://www.baidu.com '); window.open (' http://www.baidu.com '); }//</script> </pead> window.open timeout 500ms window.open timeout 850ms window.open timeout 900ms wi Ndow.open Timeout 1000Ms window.open New A click Timeout 10ms window.open window.open local domain timeout 100ms window.open local domain Test operation Open <!--do not intercept--> a href target blank a href target blank local domain <div onclick= "test ()" ;d IV Time 500</div> <button onclick= "test ()" >button Time 500</button> img <!--firef Ox, Maxthon under test OK, ie under test on this page can be said to open the target, or target= "", the new page opened in IE interception set for high no chrome, the next pop-up, turn off the page, and then point does not reflect the--> <form action= "http://www.baidu.com" target= "xxx" method= "get" accept-charset= "Utf-8" > Form Submit <p><input Type= "Submit" value= "continue→"/></p> </form> <body> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Summary:
1. Application to open on a new page, use a plus href to put some other functions on the onclick, such as
<a href= "http://www.baidu.com" target= "_blank" onclick= "alert (1)" ></a>
2. Some applications to open in the new page, with the CGI on, you can use the HTTP 302 jump
<a href= "http://www.example.com/cgi?myid=1" target= "_blank" onclick= "alert (1)" ></a>
Http://www.example.com/cgi?myid=1 will jump to the page you want
3. Be sure to use JS in a new page to open the page, with window.open can
<a href= "javascript;" onclick= "window.open (' http://www.baidu.com '); return false;" ></a>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.