Grab the RSS feed

Page Redirection Using Jquery

Sometimes we need to redirect the page from the current page to another page.For example if the login is successful the we need to redirect into the Myprofile page or another page wherever you want.

This is simple in Jquery.

Like the javascript window.location.href here also we have the function to redirect.

In the below example I illustrate the page redirection with simple button.If you want to make it depend upon user input in textbox there is also a code.For that you can simply remove the comment lines and use it.

The code is given below

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "" >
< xmlns="">
< equiv="Content-Type" content="text/html; charset=utf-8">
< src="jquery/jquery.js" type="text/javascript">< /script >
/*Remove the comment line and put the comment line in var url="";*/
/*It will redirect to the particular page given by user in text box*/
//var url=$("#testing").val();

var url = ""; 

< /script >
< /head >
< !--Remove the below comment line when you want to enter the URL and redirect it-- >
< !--Redirect Url:< type="text" name="testing" id="testing">
< type="button" name="pageredirect" id="pageredirect" value="Redirect">
< /body >
< /html >

click here to download at pdf format

Leave the comments…


    Real Time Web Analytics