HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <body> <h1>jQuery getScript() Method</h1> <p>getScript() with callback (Check your console).</p> <button onclick="myFunction()">Click Me</button> <script> $(document).ready(function(){ $.getScript("/script/alert-me.js") .done(function(script, textStatus) { console.log(textStatus); }); }); </script> <p><strong>Note</strong>: Javascript file used in this example is <a href="/script/alert-me.js" target="_blank">alert-me.js</a></p> </body> </html>
OUTPUT
×

Save as Private