Sorry for the delay in getting back to you guys. My email was down all day yesterday. Anyway, this should do it now

http://github.com/kswedberg/jquery-cluetip/tree/master

you should be able to do

$('foo').cluetip({
  ajaxSettings: {
    beforeSend: function(xhr) {
      // whatever
    },
    complete: function(xhr, textstatus) {
      // whatever
    }
  }
});

and so on.

--Karl
____________
Karl Swedberg
www.learningjquery.com
www.englishrules.com




On Apr 20, 2009, at 10:52 AM, DotnetShadow wrote:


I am having the exact same problem even with the latest code and like
yourself I have had to edit the plugin I've been having a similar
discussion here:

http://groups.google.com/group/jquery-en/browse_thread/thread/594721dc160949fa/5b91e7890e38ad72?lnk=gst&q=dotnetshadow#5b91e7890e38ad72

Regards DotnetShadow

On Apr 20, 11:51 pm, zendog74 <n8cs...@gmail.com> wrote:
Thanks Karl. So, does the latest version of clueTip support all of the
ajax options? I had to modify the plug-in previously to support
sending some custom headers.

Also, the xhr option looks like it may work for what I am trying to
do, but I am not sure exactly how to use it. I don't really want to
override the xhr object... I just need access to it to get the http
status code. The server component I am calling will return various
status codes for various problems with the call (authentication,
missing params, etc...), so I need to be able to pull it out and check
it.

On Apr 19, 2:05 pm, Karl Swedberg <k...@englishrules.com> wrote:

Since the plugin uses $.ajax(ajaxSettings) internally to retrieve the file contents, you can pass any options you want into the ajaxSettings option and they'll be used. So you should be able to do something like
this:

$('someelement').cluetip({
   ajaxSettings: {
     xhr: function() { }
   }

});

Seehttp://docs.jquery.com/Ajax/jQuery.ajax#optionsfora list of
$.ajax options. Also, make sure you use jQuery 1.3 or above and the
latest clueTip version on Github 
(http://github.com/kswedberg/jquery-cluetip/tree/master
  )

--Karl

____________
Karl Swedbergwww.englishrules.comwww.learningjquery.com

On Apr 16, 2009, at 2:52 PM, zendog74 wrote:

I am successfully using clueTip to make ajax requests that return
either xml or json and populate the tooltips. It is working great.
However, I am trying to make my code more sophisticated to handle
exceptions and I need access to the xhr to do that properly. I have
been unable to find a way to get access to the xhr using clueTip,
especially in the ajaxProcess function. Is there a way to do this?

Here is what I am trying to do:

ajaxProcess: function(xhr, data) {
               return checkResponse(xhr.status, data);
           }

//Pseudo-code
function checkHttpStatusCode(statusCode, data){
 //Check the status code and send back the error message in the
returned xml packet if there is one.

}

Reply via email to