AJAX notifies if there is a redirect


I have a simple ajax script to download the content of a file.
I want to show a warning if there is a redirect

$(document).ready(function(){
    $("button").click(function(){
        $("#div1").load("demo_test.txt #p1");
    });
});

      


Any help? thanks in advance

+3


source to share


1 answer


The $ .load function works like this, you have to call it like this:



$("#div1").load("demo_test.txt", function() {
   alert("Load was performed.");
});

      

+1


source







All Articles