This should be really simple but for some reason I'm stumped on this...
I'm trying to set the position of an element on page load from ajax data
like so:
$.ajax({
url: "session_data.php",
type: 'POST',
async: false,
success: function (data) {
$('#dragable_box').css( data );
console.log("Stored Session Data: " + data);
}
});
the data variable returns a correct result as I can see it in the console and I tried copying in the result as a test and it positioned the element as expected. It just wont work with data...
I tried with and without async: false
What am I doing wrong or not doing?
dataType: 'json'to ajax options.dataType: 'json'and it works. Thanks