Home  >  Article  >  Web Front-end  >  How to jump to page target in javascript

How to jump to page target in javascript

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-06-10 15:51:132334browse

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>

2.ContentList The iframe name of the current page

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

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=&#39;text/javascript&#39;>window.parent.frames.location.href = &#39;../welcome.en&#39;;</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!

Statement:
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