I have written a script that fires a jQuery POST to retrieve data from a server side file as JSON, the code is below:
$.post("myfile.php", function(authDataset) {
alert(authDataset);
});
A sample of what would be returned is:
{"firstName":"x","lastName":"y","boximg":"z"}
The handler file is working perfectly, when provided with the data the function all works fine, hoever the jquery POST function just isn’t working. I’ve also tried GET and AJAX.
It is placed within the document.ready tag, I have ran every error checker including jsLint and jsFiddle but for some reason it’s not firing at all.
I’ve used alerts inside and outside the post function, but the post() isn’t getting called.
Can anyone offer a suggestion?
Thanks
A HTACCESS file on the server was forcing an SSL, which violates the Same origin policy.