Home > Web Front-end > JS Tutorial > body text

How to jump to page target in javascript

醉折花枝作酒筹
Release: 2021-06-10 15:51:13
Original
2356 people have browsed it

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'".

How to jump to page target in javascript

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>
Copy after login

2.ContentList The iframe name of the current page

window.ContentList.location.href = &#39;../welcome.en&#39;;
Copy after login

Extension information:

Jump out of the frame, on the parent page.

jsp:

<script language="javascript"> 
window.parent.frames.location.href="../welcome.en" 
</script>
Copy after login

java:

PrintWriter out = response.getWriter(); 
out.write("<script type=&#39;text/javascript&#39;>window.parent.frames.location.href = &#39;../welcome.en&#39;;</script>"); 
return;
Copy after login

[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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template