View difference between Paste ID: EjShD1Jw and 4s8Kpjbh
SHOW: | | - or go back to the newest paste.
1
$("#login").click(function(){
2
if($("#username").val().length > 0 && $("#password").val().length > 0){
3
         			$.ajax({
4
				url:"login.php",
5
				data:{username:$("#username").val(),password:$("#password").val()},
6
				type:"POST",
7
				success: function(data){
8
				if(data == "ok") window.location = "success.php";
9
				else $("#slfErrorAlert").html(data).show();	
10
				}
11
				});
12
}
13
else {
14
$("#slfErrorAlert").html("Username and password is required").show();	
15
}
16
   	return false
17
	});