Currently I am trying to get javascript code working that I didn’t write (and I’m only just learning it), after a lot of research and playing around I have guessed that the following code is the problem –
$("#btnLogin").click(function(){
// Check the player login in DB
//alert("This code is good so far.");
$.post("fetch.php", {"action": "login", "login" : $("#txtLogin").val()},
function(data){
}, "json")
})
I have edited out the code in function(data) in this example.
If I have the alert active the alert button does work – so I deduce that the click(function) works. But none of the functions ever work 🙁
Now if I change it to fetch2.php and then make that page have a simple statement of
echo "I am here.";
then that should appear, am I correct? Nothing happens when I click the log in button.
What test can I run to make sure this is the code that is causing me grief and (if it is the problem) how can I fix it?
make your php output as a json array :
this works if php is > 5.2
and in post :