Home > Article > Web Front-end > How to jump to page target in javascript
Method: 1. Jump from one frame to another with the syntax "window.framename.location.href="address?key=" key"; 2. Refresh the current page, "window. Current page page name.location.href='address'".
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
1. Jump from a frame to the frame with name="main".
<script language="javascript"> var key = document.getElementById(" ## ").value; window.parent.main .location.href= "welcome.en ? key=" + key; </script>
2.ContentList The iframe name of the current page
window.ContentList.location.href = '../welcome.en';
Extension information:
Jump out of the frame, on the parent page.
jsp:
<script language="javascript"> window.parent.frames.location.href="../welcome.en" </script>
java:
PrintWriter out = response.getWriter(); out.write("<script type='text/javascript'>window.parent.frames.location.href = '../welcome.en';</script>"); return;
[Recommended learning: javascript advanced tutorial]
The above is the detailed content of How to jump to page target in javascript. For more information, please follow other related articles on the PHP Chinese website!