Pretty much I feel like I've tried everything. the data is write and sends out {"beans":1337,"uid","five"}, but I can't get the php code working. I'm trying to have the alert(data.response) return 1337, but right now I just get a blank alert statement
HTML Code:
var data = {};
data.beans = 1337;
data.uid = 'five';
var dataString = JSON.stringify(data);
$.ajax({
type:'GET',
url:'http://mvmdesign.org/other/Beacon/ws/user_data.php',
dataType:'jsonp',
data:{data:dataString},
contentType:'application/json',
success: function(data) {
alert(data.response);
}
});
Then check your PHP error log to find out what exactly was received.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Sounds as if your PHP config has the now-deprecated magic_quotes_gpc "feature" turned on. You might want to consider either turning it off if you can, or else negating it's effects before using any get, post, or cookie data.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks