i dont know what is actual problem in the below code, but it doesn't work as i expected.
<html>
<head>
<script type='text/javascript' src='jquery-1.4.2.min.js'></script>
<script type='text/javascript'>
$(document).ready(function(){
$('#clickme').click(function(){
var uid="[email protected]";
var upass="sample";
$.ajax({
type : 'GET',
url : 'http://www.example.com/test.php',
data: {
em : uid,
pass : upass,
action : 'check'
},
success : function(msg){
alert(msg);
},
error : function(XMLHttpRequest, textStatus, errorThrown){alert(errorThrown);}
});
});
});
</script>
</head>
<body>
<input type='button' value='click' id='clickme' />
</body>
</html>
In that test.php i simply tried to echo "hello world" or echo $_GET['action']
But none of this worked i got only empty message? can some one help me in this issue?
Thanks!
GET. Secondly, are the pages on the same domain?http://www.example.com/test.php