I have a situation where, when I send an ajax call through visualforce page by adding jquery through
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
and making ajax call like this :
jQuery.getJSON('https://localhost:44321/Api/SFGetData?callback=?&mType=ad&isRequired=false', function(json){
console.debug(json.Data);
});
Now when I made a lightning component and added jquery from static resource like this :
<ltng:require scripts="{!$Resource.jquery}"
afterScriptsLoaded="{!c.doInit}" />
and then calling ajax request in doInit function like this again :
jQuery.getJSON('https://localhost:44321/Api/SFGetData?callback=?&mType=ad&isRequired=false', function(json){
console.debug(json.Data);
});
The difference that I am able to find here is that the 1st call which gives correct data has initiator = "jquery-3.3.1.min.js:2" and initiator of 2nd call is : aura_prod.js:15
The initiators were verified from Chrome developer console in Network tab :