I'm trying to attach my jquery code to the 3rd party site, so I'm inserting a button which triggers a request when a page is loaded. An issue I have is that .done callback is not triggered, but .always is got triggered. The only one thing worth to mention is that the page, I try to work with, also makes some ajax request after it's loaded. Could it be a reason why I have the issue?
$("<button>Test</button>").click(function(){ var url="<https url from the site>"; $.ajax(url).done(function(data){ console.log(data); }); }).insertBefore("div.top");
$.ajax(url).done(function (data) { console.log(data); }).fail(function (jqXHR, status, error) { console.log(jqXHR, status, error) });console.log(arguments)can save you debugging time! Probably about 5 seconds per argument set, 5*2 = 10 seconds of time.