Convert from: JS pop-up new window without being blocked by the browser
Sometimes you want to use js to open a new window, but the window opened using window. Open is always blocked by the browser,
You can use the following method to open a new window without being intercepted.
1. Add a new form
<Form ID = "emailform" Action ="Target page"Method =" get"Target= "_ Blank">
<Input id = "emailid" name = "emailid" type = "hidden"/> //Hidden field, used to put parameters to be passed
</Form>
Note that the target attribute of form must be set to _ blank.
2. Submit this form
Function btneditemail_onclick (){
Document. getelementbyid ("emailid"). value = ID ;//Initial hidden domain
Document. getelementbyid ("emailform"). Submit ();//Submit
}
In this way, the new window will be opened and directed to the target page, and will not be blocked, and the new window will be used at the same time.OpenerYou can also access the original window.