Speaking of ad interception, this should be a feature of the browser, it will be the window generated by default window.open to an ad, it is blocked, but sometimes, this is not what we want, sometimes we just need it to pop up a new window on the client's browser to show the data processing updates, such as , a preview feature that creates a product that needs to save the data and then display the latest information in a new window is not a small requirement, and most people do it using window.open to pop the window, but it's not a good way!
New way to go.
We know that the form submission can actually respond to the results of the post to a new window, we are using the form of this nature, in JS to forge a form, to realize the new window display data function
// masquerading as a form submitted in a new window function newwinurl (URL) { var f=document.createelement ("form"); F.setattribute ("action" , URL); F.setattribute ("method", ' Get ' ); F.setattribute ("target", ' _black ' ); Document.body.appendChild (f) f.submit ();
When the program calls it, there may be code like this
// preview function $ ("#do"). Click (function () { $ajax ({ "get", Data: {}, function (data) { + data);});}) ;
0, it's ready for testing.