Javascript examples for jQuery Method and Property:ajax
Use Ajax to get and then run a JavaScript
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $.ajax({url: "demo_ajax_script.js", dataType: "script"}); });/* ww w . j a va 2s . c o m*/ }); </script> </head> <body> <button>Use Ajax to get and then run a JavaScript</button> </body> </html>