wordpress CMS主题 微信
Home > 网站建设 > How to realize web page to automatically jump

How to realize web page to automatically jump

高时银博客 网站建设 点击: 2,347 次 0 0
  • 标签:
  • Sometimes, in order to achieve a certain function or purpose, we should take the web automatically jump, to attract users to a new web pages. Such as: the old pages have failure, and so on and so forth. So, how to implement web page to automatically jump? Here are three ways to implement the jump:

    Method 1: use meta tags 

    Meta tags is one of the indispensable to HTML tags, it is responsible for providing the document meta information, its main parameters are:

    The < meta content = "1; url = HTTP - equiv =" refresh "http://weblog.jenfy.cn" / > on page head between the < head > and < / head > can be achieved. But this jump, is to open the first page, can open to jump page again.

    This method gm in any environment, including static web site space.

    Method 2: use the header function 

    The header () function is one of the HTTP correlation function of the built-in PHP functions, the function to send out the HTTP protocol header to the browser. Using it can redirect URL, but even to other specified web page. The following example, after the execution will automatically open the specified page:

    <? PHP header (" Location: http://hi.baidu.com/520liuhaien/ "); ? >

    Must pay attention to, the code must be on the top of the page. Can realize the jump straight to the new page.

    This method obviously can only be used to support the PHP space environment.

    Method 3: using the Javascript language 

    < script > location = "http://www.motorhr.com"; < / script >


    This code is a open the web page just jump straight to http://www.motorhr.com! This code is applicable to any Web environment. Add a timer that will be more wonderful.

    Because today a FLASH slideshow taobao guest links can't open, was thinking about using this method to implement the open taobao guest links in the FLASH. Used, just write it down.

    版权所有 © 转载时必须以链接形式注明作者和原始出处!