I was trying to get the external JS file in my HTML using $.getScript
. However it is returning undefined
.
Then I tried with https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
that also shows the same, undefined
.
$(function() {
$.getScript("https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js", function(data, textStatus, jqxhr) {
alert(data); // undefined
alert(textStatus); // Success
alert(jqxhr.status); // 200
alert("Load was performed.");
});
});
Is there any other way we can load the external script?