3 Replies - 5955 Views - Last Post: 18 March 2011 - 05:56 PM

#1 BrianMcCumber   User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 36
  • Joined: 30-November 09

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.

$(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="";
		}
	});
});



Is This A Good Question/Topic? 0
  • +

Replies To: Jquery Redirect With Successful Login

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5612
  • View blog
  • Posts: 14,686
  • Joined: 18-April 07

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?

:)
Was This Post Helpful? 0
  • +
  • -

#3 BrianMcCumber   User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 36
  • Joined: 30-November 09

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.
Was This Post Helpful? 0
  • +
  • -

#4 BrianMcCumber   User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 36
  • Joined: 30-November 09

Re: Jquery Redirect With Successful Login

Posted 18 March 2011 - 05:56 PM

Just for the record, I used:

window.open('someDir/index.html');



It works fine now.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1