Does the load() callback function know the URL of the page it's loading?
Hi,
I'm new to jQuery so this might be a basic question. Did a quick search of the forums and the jQuery documents but didn't see an answer.
I'm calling load() with a callback function (the complete() function in the declaration below).
http://api.jquery.com/load/
.load( url, [ data ], [ complete(responseText, textStatus, XMLHttpRequest) ] )
Is there a way to figure out the address of the loaded URL from inside the callback function?
For example if I call load():
$("#success").load("/not-here.php", function(response, status, xhr) {
if (status == "error") {
var url = get_page_url(); // get_page_url() should return "/not-here.php";
var msg = "Sorry but there was an error at " + url;
// display msg somewhere
}
Is there some function like get_page_url() that will return "/not-here.php"?
Thanks, Mike