[jQuery] Re: cluetip ajax authentication
Hi there, I just tried your local code but I seem to be having problems with the beforeSend event var c = 1; $(.ic).cluetip( { ajaxSettings: { cache: true, type: POST, data: {username:' + username + ', c: + c + }, contentType: application/json; charset=utf-8, dataType: json, beforeSend: function(xhr) { xhr.setRequestHeader(X-MicrosoftAjax, Delta=true); --- ERROR: setRequestHeader doesn't exist } }, ajaxProcess: function(data1) { return data1.d; } . . . . The problem is that I have no access to the xhr object hence I get the error: setRequestHeader is not available, the only thing I have access to is the cluetip itself. So how can I actually set a header by overriding the beforeSend() method? The same problem will actually happen with the error callback where we won't be able to tell the status of xhr ie. xhr.status etc Is it possible to have access to the the request object? Regards DotnetShadow On Apr 19, 12:19 pm, Karl Swedberg k...@englishrules.com wrote: Yes, absolutely. You can add your own function to any of the $.ajax callback functions in the ajaxSettings option now. Your function will be queued first for beforeSend, complete, and success, after which the plugin's code will run. For error, however, yours will completely override the default. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Apr 18, 2009, at 9:41 PM, DotnetShadow wrote: Thanks for getting back to me, You are correct I had to modify the script hence it was a temporary fix, but now that I can use my own beforeSend() that makes it handy. Does this mean the error callback can also be defined to the ajaxSettings option? The reason I ask is because sometimes you would like your application to redirect to the login page if the forms authentication has expired instead of having the message say content could not be loaded... Thanks once again DonetShadow On Apr 18, 11:29 pm, Karl Swedberg k...@englishrules.com wrote: On Apr 17, 2009, at 11:50 PM, DotnetShadow wrote: Thanks for that, I haven't tried it yet. Does that mean we can now override the error and beforesend method? What happens when there is a redirec? Your documentation hasn't been updated, so not sure what the default behaviour is? I actually temporarly solved it using this: cluetip plugin - Need beforeSend() and error handling override http://groups.google.com/group/jquery-en/browse_thread/thread/ 74ed458... But I will have a go at your new implementation to see how it works I don't really see a solution in that post, other than to modify the plugin script itself, which, of course, isn't advisable. Am I missing something? if you pull down the most recent version from GitHub now, you can just add your own beforeSend callbacks to the ajaxSettings option. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com
[jQuery] Re: cluetip ajax authentication
Hi there, I just tried your local code but I seem to be having problems with the beforeSend event var c = 1; $(.ic).cluetip( { ajaxSettings: { cache: true, type: POST, data: {username:' + username + ', c: + c + }, contentType: application/json; charset=utf-8, dataType: json, beforeSend: function(xhr) { xhr.setRequestHeader(X-MicrosoftAjax, Delta=true); --- ERROR: setRequestHeader doesn't exist } }, ajaxProcess: function(data1) { return data1.d; } . . . . The problem I have is that it doesn't recognize the setRequestHeader method for some reason? Am I setting the header wrong? Regards DotnetShadow On Apr 19, 12:19 pm, Karl Swedberg k...@englishrules.com wrote: Yes, absolutely. You can add your own function to any of the $.ajax callback functions in the ajaxSettings option now. Your function will be queued first for beforeSend, complete, and success, after which the plugin's code will run. For error, however, yours will completely override the default. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Apr 18, 2009, at 9:41 PM, DotnetShadow wrote: Thanks for getting back to me, You are correct I had to modify the script hence it was a temporary fix, but now that I can use my own beforeSend() that makes it handy. Does this mean the error callback can also be defined to the ajaxSettings option? The reason I ask is because sometimes you would like your application to redirect to the login page if the forms authentication has expired instead of having the message say content could not be loaded... Thanks once again DonetShadow On Apr 18, 11:29 pm, Karl Swedberg k...@englishrules.com wrote: On Apr 17, 2009, at 11:50 PM, DotnetShadow wrote: Thanks for that, I haven't tried it yet. Does that mean we can now override the error and beforesend method? What happens when there is a redirec? Your documentation hasn't been updated, so not sure what the default behaviour is? I actually temporarly solved it using this: cluetip plugin - Need beforeSend() and error handling override http://groups.google.com/group/jquery-en/browse_thread/thread/ 74ed458... But I will have a go at your new implementation to see how it works I don't really see a solution in that post, other than to modify the plugin script itself, which, of course, isn't advisable. Am I missing something? if you pull down the most recent version from GitHub now, you can just add your own beforeSend callbacks to the ajaxSettings option. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com
[jQuery] Re: cluetip ajax authentication
On Apr 17, 2009, at 11:50 PM, DotnetShadow wrote: Thanks for that, I haven't tried it yet. Does that mean we can now override the error and beforesend method? What happens when there is a redirec? Your documentation hasn't been updated, so not sure what the default behaviour is? I actually temporarly solved it using this: cluetip plugin - Need beforeSend() and error handling override http://groups.google.com/group/jquery-en/browse_thread/thread/ 74ed458... But I will have a go at your new implementation to see how it works I don't really see a solution in that post, other than to modify the plugin script itself, which, of course, isn't advisable. Am I missing something? if you pull down the most recent version from GitHub now, you can just add your own beforeSend callbacks to the ajaxSettings option. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: cluetip ajax authentication
Thanks for getting back to me, You are correct I had to modify the script hence it was a temporary fix, but now that I can use my own beforeSend() that makes it handy. Does this mean the error callback can also be defined to the ajaxSettings option? The reason I ask is because sometimes you would like your application to redirect to the login page if the forms authentication has expired instead of having the message say content could not be loaded... Thanks once again DonetShadow On Apr 18, 11:29 pm, Karl Swedberg k...@englishrules.com wrote: On Apr 17, 2009, at 11:50 PM, DotnetShadow wrote: Thanks for that, I haven't tried it yet. Does that mean we can now override the error and beforesend method? What happens when there is a redirec? Your documentation hasn't been updated, so not sure what the default behaviour is? I actually temporarly solved it using this: cluetip plugin - Need beforeSend() and error handling override http://groups.google.com/group/jquery-en/browse_thread/thread/ 74ed458... But I will have a go at your new implementation to see how it works I don't really see a solution in that post, other than to modify the plugin script itself, which, of course, isn't advisable. Am I missing something? if you pull down the most recent version from GitHub now, you can just add your own beforeSend callbacks to the ajaxSettings option. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com
[jQuery] Re: cluetip ajax authentication
Yes, absolutely. You can add your own function to any of the $.ajax callback functions in the ajaxSettings option now. Your function will be queued first for beforeSend, complete, and success, after which the plugin's code will run. For error, however, yours will completely override the default. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 18, 2009, at 9:41 PM, DotnetShadow wrote: Thanks for getting back to me, You are correct I had to modify the script hence it was a temporary fix, but now that I can use my own beforeSend() that makes it handy. Does this mean the error callback can also be defined to the ajaxSettings option? The reason I ask is because sometimes you would like your application to redirect to the login page if the forms authentication has expired instead of having the message say content could not be loaded... Thanks once again DonetShadow On Apr 18, 11:29 pm, Karl Swedberg k...@englishrules.com wrote: On Apr 17, 2009, at 11:50 PM, DotnetShadow wrote: Thanks for that, I haven't tried it yet. Does that mean we can now override the error and beforesend method? What happens when there is a redirec? Your documentation hasn't been updated, so not sure what the default behaviour is? I actually temporarly solved it using this: cluetip plugin - Need beforeSend() and error handling override http://groups.google.com/group/jquery-en/browse_thread/thread/ 74ed458... But I will have a go at your new implementation to see how it works I don't really see a solution in that post, other than to modify the plugin script itself, which, of course, isn't advisable. Am I missing something? if you pull down the most recent version from GitHub now, you can just add your own beforeSend callbacks to the ajaxSettings option. --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com
[jQuery] Re: cluetip ajax authentication
Thanks a lot for bringing this to my attention. I'm working on this one now. I think I have something in place, but need to test it. Basically, all the ajax callback functions will execute the one passed in through the options object first, before anything that needs to be done within the plugin itself. The only exception will be the error callback, which will override the plugin's function. How does that sound? I'll post an update when I think I have something working. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 16, 2009, at 8:51 PM, DotnetShadow wrote: Hi there, I've been using cluetip calling an ajax page. The problem I am finding is that the ajax page is part of forms authentication so if this expires and a person hovers over an element to display the cluetip it will try and request the ajax page but come up with NTLM prompt. How can I detect that the ajax page tried to redirect to login page and suppress the NTLM username/password prompt? Regards DotnetShadow
[jQuery] Re: cluetip ajax authentication
Okay, tested the new version and it seems to be working well. Please give it a shot and let me know if you run into any problems: http://github.com/kswedberg/jquery-cluetip/tree/master thanks! --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 17, 2009, at 10:30 AM, Karl Swedberg wrote: Thanks a lot for bringing this to my attention. I'm working on this one now. I think I have something in place, but need to test it. Basically, all the ajax callback functions will execute the one passed in through the options object first, before anything that needs to be done within the plugin itself. The only exception will be the error callback, which will override the plugin's function. How does that sound? I'll post an update when I think I have something working. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 16, 2009, at 8:51 PM, DotnetShadow wrote: Hi there, I've been using cluetip calling an ajax page. The problem I am finding is that the ajax page is part of forms authentication so if this expires and a person hovers over an element to display the cluetip it will try and request the ajax page but come up with NTLM prompt. How can I detect that the ajax page tried to redirect to login page and suppress the NTLM username/password prompt? Regards DotnetShadow
[jQuery] Re: cluetip ajax authentication
Thanks for that, I haven't tried it yet I actually temporarly solved it using this: cluetip plugin - Need beforeSend() and error handling override http://groups.google.com/group/jquery-en/browse_thread/thread/74ed458203e6147b/5e9dd005a7b349b2?lnk=gstq=dotnetshadow#5e9dd005a7b349b2 But I will have a go at your new implementation to see how it works Thanks again Dotnetshadow On Apr 18, 3:24 am, Karl Swedberg k...@englishrules.com wrote: Okay, tested the new version and it seems to be working well. Please give it a shot and let me know if you run into any problems: http://github.com/kswedberg/jquery-cluetip/tree/master thanks! --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Apr 17, 2009, at 10:30 AM, Karl Swedberg wrote: Thanks a lot for bringing this to my attention. I'm working on this one now. I think I have something in place, but need to test it. Basically, all the ajax callback functions will execute the one passed in through the options object first, before anything that needs to be done within the plugin itself. The only exception will be the error callback, which will override the plugin's function. How does that sound? I'll post an update when I think I have something working. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 16, 2009, at 8:51 PM, DotnetShadow wrote: Hi there, I've been using cluetip calling an ajax page. The problem I am finding is that the ajax page is part of forms authentication so if this expires and a person hovers over an element to display the cluetip it will try and request the ajax page but come up with NTLM prompt. How can I detect that the ajax page tried to redirect to login page and suppress the NTLM username/password prompt? Regards DotnetShadow
[jQuery] Re: cluetip ajax authentication
Thanks for that, I haven't tried it yet. Does that mean we can now override the error and beforesend method? What happens when there is a redirec? Your documentation hasn't been updated, so not sure what the default behaviour is? I actually temporarly solved it using this: cluetip plugin - Need beforeSend() and error handling override http://groups.google.com/group/jquery-en/browse_thread/thread/74ed458... But I will have a go at your new implementation to see how it works Thanks again Dotnetshadow On Apr 18, 3:24 am, Karl Swedberg k...@englishrules.com wrote: Okay, tested the new version and it seems to be working well. Please give it a shot and let me know if you run into any problems: http://github.com/kswedberg/jquery-cluetip/tree/master thanks! --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Apr 17, 2009, at 10:30 AM, Karl Swedberg wrote: Thanks a lot for bringing this to my attention. I'm working on this one now. I think I have something in place, but need to test it. Basically, all the ajax callback functions will execute the one passed in through the options object first, before anything that needs to be done within the plugin itself. The only exception will be the error callback, which will override the plugin's function. How does that sound? I'll post an update when I think I have something working. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Apr 16, 2009, at 8:51 PM, DotnetShadow wrote: Hi there, I've been using cluetip calling an ajax page. The problem I am finding is that the ajax page is part of forms authentication so if this expires and a person hovers over an element to display the cluetip it will try and request the ajax page but come up with NTLM prompt. How can I detect that the ajax page tried to redirect to login page and suppress the NTLM username/password prompt? Regards DotnetShadow