window.open by Browser Shielding solution

Source: Internet
Author: User

First look at a common window.open open window instance

The code is as follows Copy Code
<SCRIPT>
<!--
window.open (' page.html ', ' newwindow ', ' Height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, Resizable=no,location=no, Status=no ')
Write a line
-->
</SCRIPT>

After the script is run, page.html will be opened in the new form NewWindow, wide 100, high 400, 0 pixels from the top of the screen, 0 pixels from the screen, no toolbar, no menu bar, no scroll bar, no resizing, no address bar, no status bar, but the result is not open, The check later found that the browser window.open the solution, and later found a piece of code to solve the problem.


Look at the code directly

The code is as follows Copy Code

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >



<title></title>

<script type= "Text/javascript" src= "Http://code.jquery.com/jquery-1.4.1.min.js" ></script>

<script type= "Text/javascript" >

<!--

$(

function ()

{

Method One

window.showModalDialog ("http://www.111cn.net/");

window.showModalDialog ("http://www.111cn.net/");


Method Two

var aa=window.open ();

settimeout (function () {

Aa.location= "Http://www.111cn.net";

}, 100);


var b=window.open ();

settimeout (function () {

B.location= "Http://www.111cn.net";

}, 200);


var c=window.open ();

settimeout (function () {

C.location= "Http://www.111cn.net";

}, 300);


var d=window.open ();

settimeout (function () {

D.location= "Http://www.111cn.net";

}, 400);


var ee=window.open ();

settimeout (function () {

Ee.location= "Http://www.111cn.net";

}, 500);


var f=window.open ();

settimeout (function () {

F.location= "Http://www.111cn.net";

}, 600);


var g=window.open ();

settimeout (function () {

G.location= "Http://www.111cn.net";

}, 700);


var h=window.open ();

settimeout (function () {

H.location= "Http://www.111cn.net";

}, 800);


var i=window.open ();

settimeout (function () {

I.location= "Http://www.111cn.net";

}, 900);


var j=window.open ();

settimeout (function () {

J.location= "Http://www.111cn.net";

}, 1000);


Method Three

var a = $ ("<a href= ' http://www.111cn.net ' target= ' _blank ' >Apple</a>"). Get (0);

var e = document.createevent (' mouseevents ');

E.initevent (' Click ', True, true);

A.dispatchevent (e);


var a = $ ("<a href= ' http://www.111cn.net ' target= ' _blank ' >Apple</a>"). Get (0);

var e = document.createevent (' mouseevents ');

E.initevent (' Click ', True, true);

A.dispatchevent (e);

}



);

-->

</script>


<body></body>

Related Article

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.