Answers for "check if a js file is loaded"

4

check if jquery is loaded

$(document).ready(function(){
  if (jQuery) {  
    // jQuery is loaded  
    alert("Yeah!");
  } else {
    // jQuery is not loaded
    alert("Doesn't Work");
  }
});
Posted by: Guest on April-15-2020
0

javascript check if script is loaded

if (typeof window.myCustomFlag == 'undefined') {
    //the flag was not found, so the code has not run
    $.getScript('<external JS>');
}
Posted by: Guest on August-11-2021

Code answers related to "check if a js file is loaded"

Code answers related to "Javascript"

Browse Popular Code Answers by Language