How to use location.replace in a jquery function?

FairyBusiness
FairyBusiness used Ask the Experts™
on
Hi,

I am trying to have the page redirect once the submit button is clicked:

      
// Save data when the #data form is submited
	$("#data").submit(function() {
		// Set local sessions from the form elements
		db.setItem("firstName", $("#firstName").val());
		db.setItem("lastName", $("#lastName").val());
		db.setItem("email", $("#email").val());
		db.setItem("username", $("#username").val());
		db.setItem("password", $("#password").val());
		
		window.location.replace("http://www.cs.iupui.edu/~tleithof/n300/final.html");
	});

Open in new window


http://www.cs.iupui.edu/~tleithof/n300/final.html#signup

But it just remains on the same page.  Any suggestions?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011

Commented:
Where are the alerts coming from?  I don't see them in the source... are you sure the right click function is running?

Author

Commented:
yes, ok check again
Commented:

// Try changing this line:
// window.location.replace("http://www.cs.iupui.edu/~tleithof/n300/final.html");

// To
window.location.href = "http://www.cs.iupui.edu/~tleithof/n300/final.html";

Open in new window

Author

Commented:
thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial