Home >Web Front-end >JS Tutorial >Commonly used js.window properties and methods (detailed introduction, graphic tutorial)
The following are the js.window properties and methods that I have compiled for you. Interested students can take a look.
##window.opener.location.reload()
##This method In the case of some IE browsers (such as high security settings), a confirmation dialog box will pop up, prompting whether to refresh the page again. This method is replaced by window.opener.location.href=window.opener.location .href;There will be no such problem.
window.opener.location.href is just a link
If you want to realize the submission of the parent window, you need to call the window.opener.action="" and window.opener.submit(); methods, but unfortunately this code cannot run under Firefox. The solution is to Write a submitted function in the window and call it through window.opener.functionname() in the child window.
Usually when using window.opener, you have to judge the status of the parent window. If the parent window is closed or updated, an error will occur. The solution is to add The following verification if(window.opener && !window.opener.closed) window.opener.location.replace(); This method specifies URLReplace the item currently cached on the client, so after using the replace method, you cannot access the replaced URL through "forward" and "backward". In actual application, when refreshing the page, we usually use: location.reload() or history.go(0). Method to open the window: Method 1: Method 2: The above is the js.window properties and methods I compiled for everyone. I hope it will be helpful to everyone in the future. Related articles: JS loading jquery.jsDetailed steps
Because this approach is like the client clicking F5 to refresh the page, so when the page method="post" is used, a "webpage expired" prompt will appear. That's because of Session's security protection mechanism. Response.Write("<script language=javascript>window.open('down.aspx','newwindow','width=200,height=200')</script>");
Response.Write("<script language=javascript>alert('注册成功');window.window.location.href='down.aspx';</script> ");
The above is the detailed content of Commonly used js.window properties and methods (detailed introduction, graphic tutorial). For more information, please follow other related articles on the PHP Chinese website!