Option 1
window.urlSite=$(this).attr('href'); b1 = $.ajax($(this).attr('href')); b1.done(function (d1) { analysisSite(d1,mask2,window.urlSite); }); Option 2
b2 = $(this).attr('href'); b1 = $.ajax($(this).attr('href')); $.when( b1, b2 ).done(function ( d1, d2 ) { analysisSite(d1,mask2,d2); }); in the first one, the analysisSite () function is running normally. In the second - the alert says that the page is received. But for some reason the code does not want to work further with it.
I need the second option, in addition to the requested page, to provide a link to this page. The first option does not transmit this information.
window.urlSite, in the second,$(this).attr('href'), if these values do not match, it is not surprising that they work differently. More specifically, one can only say after seeing how all this is called, and what is inside theanalysisSite- Grundy