Reputation: 31
i try to send via ajax a simple string, but the php GET var is 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']; ?>
Upvotes: 0
Views: 154
Reputation: 20189
Maybe You should try this
$.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");
}
});
Upvotes: 2