Monday, 05 February 2007 18:00

How To Redirect a Page in HTML

   

 

Knowing how to redirect a webpage can be invaluable to website owners. Let's say you have numerous sites linking to a webpage on your site. For some reason you have to change the directory or filename of that webpage. Instead of leaving a broken link for visitors to be frustrated with, you should create a replacement page containing a redirect code.

Simply put the following code into your replacement page.

<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.website.com/page.html">



This code should be placed between the <HEAD> and </HEAD> tags in your website code. The 0 in the code is the amount of seconds the website will wait before redirecting the visitor. If you want the transfer to be instant, leave this number at 0.
Published in HTML
Tuesday, 27 March 2007 12:11

How To Open a Link In a New Window (HTML)

    

 

Opening a link in a new window is an effective way to keep your visitors on your site.  Links made to other websites should open in a new browser window so your users won't forget what site they were at originally. 

 

If you are using frames, each frame has a different name and you can tell a browser which frame to open your link in by specifying a target.  If you are using a webpage with no frames or if you simply want to open a link in a new window, use the following code: 

 

  • Use the code <a href="http://www.yourlinkpage.com" target="_blank">Link Text</a> The "_blank" section is telling the browser to open the link in a frame called "_blank".  Since there is no frame that can be named _blank, it will open your link in a new window.
 
Javascript can also be used to open links in new windows, however, javascript can cause errors if not programmed correctly and is generally not needed to perform simple tasks like this. 

 

 

Published in HTML