tag:blogger.com,1999:blog-3718956085911858962.post7405624681652429035..comments2023-12-27T14:48:02.113+05:30Comments on Electric Sheep Blog: jQuery: No headers on successAnonymoushttp://www.blogger.com/profile/11938300811286150164noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-3718956085911858962.post-41677439630074517612008-11-11T03:28:00.000+05:302008-11-11T03:28:00.000+05:30@neerbos - I could do, but my compulsive urge for ...@neerbos - I could do, but my compulsive urge for consistency gets in the way :)<BR/><BR/>@bitsucker - Agreed; without modifying the original source, global variables seem to be the only option. Not a path I'd choose to walk though - modifying the source seemed the lesser evil.<BR/>For you're second point - not a clue. I'd like to know too, so do let me know if you find out.Anonymoushttps://www.blogger.com/profile/11938300811286150164noreply@blogger.comtag:blogger.com,1999:blog-3718956085911858962.post-59881919264916239832008-11-06T12:00:00.000+05:302008-11-06T12:00:00.000+05:30I agree that exposing the xhr to the success callb...I agree that exposing the xhr to the success callback looks like a natural enhancement, and I'm not experienced with jquery (long-time prototype user) so I might be missing some stylistic conventions... Anyway, seems worthwhile to point out that your "gross misuse of closures" isn't the only way to expose the xhr returned by the call to the callback: the outer code could alternatively save the object somewhere (as a property on some app object) for the callback to retreive it. I do like your way better, but for those that don't want to patch the lib: other options exist.<BR/><BR/>Another (perhaps more important?) observation: I'm not certain, but I thought I'd heard that the callback for an xhr could possibly be invoked SYNCHRONOUSLY -- which is to say, in the same call-stack, before the outer invocation returns the xhr object at all (this is certainly the case with many other async APIs, anyway). In that case, passing the object directly to the callback (as in your patch) would be the ONLY way to guarantee its availability... Anyone know the contract for the xhr API?bitsuckerhttps://www.blogger.com/profile/08606093667742884460noreply@blogger.comtag:blogger.com,1999:blog-3718956085911858962.post-1118946564158534642008-11-05T15:03:00.000+05:302008-11-05T15:03:00.000+05:30Why not use the complete callback when using the a...Why not use the complete callback when using the ajax function? See the <A HREF="http://docs.jquery.com/Ajax/jQuery.ajax#options" REL="nofollow">jquery docs</A> <BR/><BR/>This gives you access to the XMLHttpRequest.neerboshttps://www.blogger.com/profile/15375521605516617080noreply@blogger.comtag:blogger.com,1999:blog-3718956085911858962.post-60278943246406866222008-11-02T09:30:00.000+05:302008-11-02T09:30:00.000+05:30This is something that the community has always ra...This is something that the community has always rallied around John Resig and team to patch but never got to. As a matter of fact many of them, for their deployments fixed it they way you did. Support.com is one example.Anonymoushttps://www.blogger.com/profile/02081361997342134240noreply@blogger.com