jquery - Ajax GET but php variable is null -
i try send via ajax simple string, php var null. thank you
function postjson(){ $.ajax({ type: "get", url: "http://www.my-server.de/file.php", data: { 'datastring': "juhu" }, cache: false, success: function() { alert("order submitted"); }, error: function() { alert("error"); } }); php:
<?php echo "value is:"; echo $_get['datastring']; ?>
maybe should try
$.ajax({ type: "get", url: "http://www.my-server.de/file.php", data: { 'datastring': "juhu" }, cache: false, success: function( response ){ alert( response ); }, error: function() { alert("error"); } });
Comments
Post a Comment