loginBtn click function console log loging in ajax url main php type G

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$("#loginBtn").click(function() {
console.log('loging in..');
$.ajax({
url: "main.php",
type: "GET",
//data: { req: "userStatus" },
data: { module: "connect", request: "login", login: $("#login").val(), password: $("#psw").val()},
dataType: "JSON"
}).then( function(incomdata){
//console.log(incomdata.info);
//data.user = incomdata;
if(incomdata.info.action == true)
{
$("#container").hide();
console.log(incomdata.info.message);
}
else
{
console.log(incomdata.info.message);
}
});
});