MrZ
MrZ

Reputation: 123

AJAX notify if there's a redirect


I have a simple ajax script to load the content of a file.
I want to show an alert if there's a redirect

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


Any help ? Thanks in advance

Upvotes: 3

Views: 40

Answers (1)

Kresimir Pendic
Kresimir Pendic

Reputation: 3614

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

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

Upvotes: 1

Related Questions