[jQuery] Asp.net __doPostBack errors

[jQuery] Asp.net __doPostBack errors

First off, I love jQuery and I don't think words can possibly express
how much easier it makes my life.
Now, Asp.Net forms generate this little bit of javascript it uses to
raise events on the server:
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
There's not much I can do about the quality of this snippet-- this is
how it is, this is what Asp.Net generates. The issue I'm having is
with the "if (!theForm.onsubmit || (theForm.onsubmit() != false)" bit,
since it seems like with jQuery loaded it ends up raising an error in
the fixEvent() function-- basically, since no "real" event has been
fired (just onsubmit() called), fixEvent ends up getting passed a null
reference.
I "fixed" this problem by adding this line to the top of fixEvent():
if (!event) event = {};
I'm really not that familiar with how jQuery deals with events (beyond
a cursory glance), but this seems to fix my problem. Obviously this
is a nasty, hackish workaround and will result in failures if any
event handler code actually tries to do things like stop propagation,
but obviously Microsoft were just hoping that no one would try
anything that daring.
Sorry if this was a bit long-winded. Thanks for a great library!
-Matt
--
Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id=19029&t=1>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/