Global GuideLine Home HTML Tutorial JavaScript Tutorial SQL Tutorial CSS Tutorial SEO Tutorial XML Tutorial XSLT Tutorial Articles Tutorial Interview Questions and Answers Guide Jobs GuideLine Bookmark With Google Bookmark With Yahoo Bookmark With FaceBook Bookmark With Live Follow @GlobalGuideLine on Twitter Bookmark Global GuideLine
JavaScript Redirection, JavaScript Tutorial, Global Guide Line Technology.
Bookmark this webpage. Bookmark: JavaScript Redirection, JavaScript Tutorial Global Guideline is UNITED STATES's favorite website

      Home                    

Basic JavaScript Guide.
 JScript Introduction.            
 JScript Why?                       
 JScript Recognitions.          
 JScript onMouseover.         
 JScript with Buttons.           
 JScript Alerts.                     
 JScript Variables.               
 JScript Operators.               
 JScript Functions.               
 JScript Prompts.                 
 JScript Conditions.             
 JScript Validations.            
 JScript Confirmation Boxes.
 JScript Browser Detection.  
 JScript Redirection.
 JScript on Links.                 
 JScript Switch.                    
 JScript Loops.                     
 JScript Events.                    
 JScript Exception Handling.
 JScript Reserve Characters. 
 JScript with Objects.            
 JScript Math Object.           
 JScript using Dates.             
 JScript using String.            
 JScript using Arrays.            
 JScript Operations.              
 JScript Handling Cookies.   
 JScript in Mapping.             
 JScript Time Out.                
 JScript Summary.                

Learn JavaScript with Examples
Learn JavaScript with hundred of short examples with code and output.
Complete_JScript_Examples.php

JScript Interview Questions & Answers
Learn JavaScript by thousands of Interview Questions & Answers.
JavaScriptQuestions/index.php

JavaScript Tutorial >> JavaScript Redirection.


     Back             Next     





Some times we need to redirect our visitors to an other location, the following redirect code will do redirection to any given webpage address,  the syntax of JavaScript Redirection is as under.

Syntax for JavaScript Redirection [window.location]

window.location="http://www.globalguideline.com";

There are many reasons for using a redirect code within our web page. However, the most popular reason is to redirect visitors to a new webpage when we've changed the location of the original webpage. If we don't, our visitors will receive an error page, which will cause them to leave our website and probably never return. Second major use of JavaScript redirection can be, when some times our visitors fill the HTML forms and after completion of form completion we redirect them to welcome page and if fill-in form filled incorrectly then we redirect them to an error page.

Another good reason to use a redirect code within a web page that has moved is the Search Engines. When we create your web site and upload it to any web server, chances are, our pages will be quickly indexed by the Search Engines, as many Search Engines continually crawl the Internet in search of new web pages. If we don't use a redirect code to redirect our Search Engine visitors to our new web page, we may lose these visitors forever.

We can also redirect our visitors by HTML meta tags but here in this section of JavaScript Tutorial we will discus and explain only Redirection using JavaScript the only over view for meta redirection is as under.

Redirection using HTML META tags.

<META http-equiv="refresh" content="5; URL=http://www.globalguideline.com">

The above line of HTML Meta tag for redirection to a given URL works same like JavaScript Redirection.  Again it will keep our visitors in touch and just forwarding them to a new location.

Note: When using redirect codes within our web page, please make sure we aren't using this redirect code for unethical purposes, such as trying to trick the Search Engines into for up ranking your web page higher. This action could get our web site banned by search engines. Please ensure to use only ethical means in which to obtain web site traffic.

Example of JavaScript Redirection

<SCRIPT LANGUAGE="JavaScript">
<!--
function redirectToGGL(){
  window.location="http://www.globalguideline.com/";
}
// -->
</script>


     Back             Next     
 

JavaScript Redirect Examples.



Examples of JavaScript Location Object



In order to link this page as Reference, click on below text area and pres (CTRL-C) to copy the code in clipboard or pres right click then copy the following lines after that past into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code:

[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright © 2005-2006 www.globalguideline.com All rights reserved. Join Global Guide Line community. 440 visitors are online now