Go Around The Tech Corner…

JS Tip 5: How to Redirect Pages using JavaScript

Posted on: December 5, 2009


You can use JavaScript code to redirect user to a page you want. For instance, when a user tries points his/her address bar to http://mywebsite.com, you can have that page automatically redirected to http://www.mywebsite.com using only one line of JavaScript code!

All you need to do is to paste the following code in the <head> section of your html page:

<script language=”JavaScript”>
window.location=”http://www.mypage.com
</script>

This function can also be used to redirect users to appropriate versions of web pages depending on which browser they are using. It’s a very simple and handy script, easy to remember and easy to use. Do comment on any other ways of redirecting a user to another page that you may know of!

–          Millie

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Me – The author of this blog!


This is my tech blog. I got another blog, full of jokes that will crack u up! http://humoraddict.blogspot.com

Follow milliepatel84 on Twitter

Tweet Tweet…!!!!

Blog Stats

  • 44,031 hits

Top Clicks

  • None

Flickr Photos

%d bloggers like this: