Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of javascript Jump, return and Refresh Page

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the "javascript jump, return and refresh page case analysis", in the daily operation, I believe that many people in the javascript jump, return and refresh the page case analysis problems, the editor consulted all kinds of data, sorted out a simple and useful method of operation, hope to answer the "javascript jump, return and refresh page case analysis" of the doubt to help! Next, please follow the editor to study!

The difference between window.open () and _ window.location.href in javascript

1. Window.open ('index.html') means adding a window to open the index.html page without refreshing it.

Location.href ('index.html') means to redirect to a new page in the current window, open and refresh the index.html page

2. _ window.location is a property of the window object to replace the current page, that is, to relocate the current page

Window.open is the method of the window object and the function used to open a new window.

/ / Open a new page / / Note: some browser security settings block window.open (), such as avoiding pop-up advertising window window.open ('. / index.html'); / / opening a new page _ window.location.href= ". / index.html" in the original window; window.open () details window.open ('page.html',' newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no').

Parameter interpretation: three parameters

Window.open command to pop up a new window

'The file name of the page.html' pop-up window

The name of the newPage' pop-up window (not the file name). Optional, empty''can be used instead.

Height=100 window height

Width=400 window width

The pixel value of the top=0 window from the top of the screen

The pixel value of the left=0 window from the left side of the screen

Whether the toolbar is displayed by toolbar=no, or not by yes.

Whether the menu bar is displayed in menubar=no, or not in yes.

Whether the scroll bar is displayed in scrollbars=no, or not in yes.

Whether resizable=no is allowed to change the window size, yes is allowed.

Whether location=no displays the address bar. Yes is allowed.

Whether status=no displays the information in the status bar (usually the file is already open). Yes is allowed.

Commonly used js returns and refreshes pages

Use the a tag here as an example

Return to the previous page return to the previous two pages to refresh the current page

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report