I use
$("#result").html(ajax_load).load(loadUrl, null, function (responseText) {
$('body').css('overflow-y', 'scroll');
});
to load a page inside a div and from the loaded page I tried to use:
$.ajax({
url: "link",
data: { 'device': device, 'latestDate': latestDate },
dataType: "jsonp"
})
and
$.getJSON equivalent.
Sometimes I can observe that the link is requested from $.ajax but I never managed to perform the request from $.getJSON.
Is it a really bad technique to call $.getJSON from code that is loaded dynamically?
Thanks.
No.
$.getJSONis really just a shorthand for$.ajax. Its the same function with some minor syntax candy to make your life easier. If$.ajaxis working for you but$.getJSONis not, then I have to conclude that your$.getJSONstatement is not really equivalent.