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

How does css jump to a page

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

Share

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

This article editor for you a detailed introduction of "css how to jump to the page", the content is detailed, the steps are clear, the details are handled properly, I hope this "css how to jump to the page" article can help you solve your doubts, following the editor's ideas slowly in-depth, let's learn new knowledge.

1. Html implementation

The code is as follows:

Our implementation of this method will be relatively simple, but the deficiency is that it cannot be used in Struts Tiles.

2. JavaScript implementation

The code is as follows:

/ / jump directly to _ window.location.href='hello.html';// in the following ways: regularly jump to setTimeout in the following ways ("_ javascript:location.href='hello.html'", 5000)

By using the JavaScript method, it is more flexible and allows us to combine more other functions, but the drawback is that it will be affected by different browsers.

3. Implement the reciprocal JavaScript in firefox.

The code is as follows:

Var second = document.getElementById ('totalSecond'). TextContent; setInterval ("redirect ()", 1000); function redirect () {document.getElementById (' totalSecond'). TextContent =-- second; if (second)

< 0) location.href = 'hello.html'; } 4、解决Firefox不支持innerText的问题 代码如下所示: 5 if(navigator.appName.indexOf("Explorer") >

-1) {document.getElementById ('totalSecond'). InnerText = "my text innerText";} else {document.getElementById (' totalSecond'). TextContent = "my text textContent";}

5. Integration

5 var second = document.getElementById ('totalSecond'). TextContent; if (navigator.appName.indexOf ("Explorer") >-1) {second = document.getElementById (' totalSecond'). InnerText;} else {second = document.getElementById ('totalSecond'). TextContent;} setInterval ("redirect ()", 1000); function redirect () {if (second)

< 0) { location.href = 'hello.html'; } else { if (navigator.appName.indexOf("Explorer") >

-1) {document.getElementById ('totalSecond'). InnerText = second--;} else {document.getElementById (' totalSecond'). TextContent = second--;}

Summary: the above examples are mainly used to automatically jump to the hello.html file in the same directory after five seconds.

After reading this, the article "how to jump to the page of css" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, please follow the industry information channel.

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