$(document).ready(function(){
$("#pswBTN").click(function(){
var paswEntry = $("#pswTBX").val();
if(paswEntry == "password")
{
alert("Password correct..."); //this will show up if pword is right
window.location="training/index.html"; //this is not happening
}
else
{
alert("Invalid password..."); //this will show up if pword is wrong
paswEntry="";
}
});
});
Jquery Redirect With Successful Login
Page 1 of 13 Replies - 5955 Views - Last Post: 18 March 2011 - 05:56 PM
#1
Jquery Redirect With Successful Login
Posted 01 February 2011 - 01:44 PM
Hello. I am trying to implement a simple password function with jquery. I can put alerts in the if/else statements and they show up right, but I am trying to get the window to redirect to a file in the local directory, but it won't redirect to the other page. The code is below, I'd appreciate any help with this.
Replies To: Jquery Redirect With Successful Login
#2
Re: Jquery Redirect With Successful Login
Posted 01 February 2011 - 01:58 PM
What is happening with it? Is it showing you a page not found error, doing absolutely nothing (stays on the same page)? Do you have this on a URL somewhere we can see?
#3
Re: Jquery Redirect With Successful Login
Posted 01 February 2011 - 08:22 PM
It looks like its loading something in the status bar then it stays on the same page.
#4
Re: Jquery Redirect With Successful Login
Posted 18 March 2011 - 05:56 PM
Just for the record, I used:
It works fine now.
window.open('someDir/index.html');
It works fine now.
Page 1 of 1

New Topic/Question
Reply



MultiQuote



|