Reputation: 123
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
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