I have got this function:
var current_url=window.location.href;
$.ajax({url: 'http://api.apps.com/html/'+appid,
data: {url:current_url},
dataType: 'jsonp',
timeout: 10000,
jsonp: "set_url_target",
success: function(data) { console.log(data); },
error: function(jqXHR, textStatus, errorThrown) { console.log(errorThrown); console.log(textStatus); }
}).done(function() {
console.log("Message has been complete!!");
});
What I want is to trigger this function on http://api.apps.com/html/ (Note it is a different domain).
function set_url_target(url){
console.log("Url has been recieved: "+url);
}
So far the set_url_target isnt being triggered, and I get nothing being printed to the console, no error or nothing.. why?