tags:

views:

113

answers:

1

I am trying to grab the requested AJAX URL generated by a plugin to use in my callback. My intention is, to say in plain English: If the current requested AJAX URL matches attribute href in a certain selector already available in the page, then do something.

  $(selector).myplugin({settings},function(){
    if (currentAjaxURL == $(another selector).attr('href') ) {
      // do something
    }
  });

Is there any way for jQuery to get currentAjaxURL via the active current requested URL? Any hint would be very much appreciated.

Thanks

A: 

Look at the global ajax events in the jquery docs, you can listen for requests being sent (before they send, when they start, when they complete etc...) and get the XMLHttpRequest object directly, then you could compare the URL to the dom element's href attribute.

machinemessiah
Thanks. Still no luck yet.
swan