i2tutorials

Javascript Location

Javascript Location

 

Javascript location(redirect) is nothing but a mechanism of sending search engines and users on a different URL from the original one.

 

Some examples:

 

 

EXAMPLE:

 

<html>
<head>
<script type = "text/javascript">
function page_redirect(){
window.location = "https://i2tutorials.com/";
}
</script>
</head>

<body>
<h2> This is an example of the page redirection </h2>
<p> Click the following button to see the effect. </p>

<form>
<input type = "button" value = "Redirect" onclick = "page_redirect()" />
</form>

</body>
</html>

 

OUTPUT:

 

Javascript Location

 

 

 

Exit mobile version