Javascript examples for jQuery Method and Property:ajaxSuccess
Check url on ajax success
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(document).ajaxSuccess(function(e, xhr, opt){ if (opt.url == "demo_ajax_load.txt") { console.log("AJAX request successfully completed"); };//w ww. j a v a 2 s . c o m }); $("button").click(function(){ $("div").load("demo_ajax_load.txt"); }); }); </script> </head> <body> <button>test</button> </body> </html>