JavaScript Redirection, JavaScript Tutorial, Global Guide Line Technology.
Bookmark Bookmark: JavaScript Redirection, JavaScript Tutorial Forum | Blog |

      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.                

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="https://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=https://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="https://www.globalguideline.com/";
}
// -->
</script>


     Back             Next     
 

JavaScript Redirect Examples.



Examples of JavaScript Location Object



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

Copyright 2005 -  2018 www.globalguideline.com All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 222 visitors are online now