A new window is displayed when the IE blocking limit is exceeded.

Source: Internet
Author: User
Write this article Article It does not mean that spam advertisers can bring up advertisements or hide pop-up windows in the background, but reminds everyone that the IE kernel has some advertisement shielding functions that can bypass most browsers with IE as the kernel in winter and winter, even bypassing these browsers, a real Internet Explorer window is displayed. Of course it is not all. Some of them are still relatively good. For example, Maxthon, although the new window is opened, it still exists in Maxthon and will not pop up an ie in the background, however, some browsers such as TT and the world won't work. They can open the new ie window directly. Since ancient times, it has been a matter of relief, hoping to have a corresponding solution.

The principle is simple. Most browsers use the pop-up ad blocking function to block window. Open. Of course, there are a few tools and software that can shield the showmodaldialog and showmodalessdialog functions, while the showmodal class functions can open a modal window as long as they can run. Ie completely encapsulates this function, so running window. open () in showmodal functions cannot be blocked.

Therefore, you can write a few JavaScript codes to use this principle.

1. Open a specified page with showmodaldialog
2. specify that there is no content in the page. You only need to execute a window. open () to open your window.
3. open this window and close it in the modal window (window. Close ())
In this way, you can indirectly open the window you want to open through the modal window.

Related Code :
Code on the home page:

<Script language = JavaScript>
// Open the modal window
Function showdialog (dialogurl ){
VaR Surl = dialogurl;
VaR sfeathers = "Help: off; resizable: off; scroll: No; Status: Off ";
// Surl = Surl
Window. showmodaldialog (Surl, "", sfeathers );
}
// Open the specified URL
Function Openurl (Surl ){
// Modal window file address
VaR dialogurl = "txdialog.htm ";
// Add random parameters and force refresh. Do not click here
Dialogurl + = "? R = "+ math. Random () * 100000;
Dialogurl + = "& url =" + Surl;
Showdialog (dialogurl );
}
</SCRIPT>

Test code

<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">

<HTML>
<Head>
<Title> untitled </title>
</Head>

<Body> enter the URL to open the window:
<Input type = "text" name = "txturl" id = "txturl" value = "http://blog.sina.com.cn/s/blog_6bcdefec0100n01d.html">
<Input type = button onclick = "Openurl (txturl. Value)" value = 'test'>
</Body>
</Html>

Put the following code in the pattern window (txdialog.htm:

<Script language = JavaScript>
Function request (strname)
{
VaR strhref = location. href;
VaR intpos = strhref. indexof ("? ");
VaR strright = strhref. substr (intpos + 1 );
VaR arrtmp = strright. Split ("&");
For (VAR I = 0; I <arrtmp. length; I ++)
{
VaR arrtemp = arrtmp [I]. Split ("= ");
If (arrtemp [0]. touppercase () = strname. touppercase () return arrtemp [1];
}
Return "";
}
VaR Surl = request ("url ");
// Alert (Surl );
Window. Open (Surl );
Window. Close ();
</SCRIPT>

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.