I have this Javascript:
var signUp = {
share: function(response) {
alert('hello');
}
}
$.getJSON("http://pgthatworks.com/?callback=?", {email:signUp.email, api:signUp.api, ref:signUp.ref}, function(response){
signUp.share(response);
});
The $.getJSON() works up to the point where it is sending the data to the page specified and that page is doing it’s job, but the function(response){} part does not execute. Any idea why?
It looks to me like you are performing a cross domain request. I say this because you have the full URL specified in your getJSON request along with a callback parameter in the query string. If this is the case, then your PHP needs to send back proper JSONP. That is: