It would be better if you'd use something like:
<script type="text/javascript">
Event.observe('element_id', 'click', function (e) { Ajax.Updater();
Event.stop(e); return false; });
</script>
And drop your inline event handlers. It's a pain dealing with stopping
events on inline handlers.
Anyway, in the code I sent, I put the 'function (e) { Ajax.Updater();
Event.stop(e); return false; }' in the inline handler. I'm not sure if
that actually works as I've always attached events separately if I
needed any access to the event object itself, but I thought it was worth
a try. When you sent the code back, you had not included the 'function
(e)' part, which may be why you are getting problems. The variable 'e'
would not be defined otherwise, or is defined in another scope and
probably not referring to what you think it is.
Greg
> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:rails-spinoffs-
> [EMAIL PROTECTED] On Behalf Of Bill Moseley
> Sent: Monday, January 16, 2006 9:16 PM
> To: [email protected]
> Subject: Re: [Rails-spinoffs] Preventing bubble
>
> On Mon, Jan 16, 2006 at 11:50:26AM -0800, Bill Moseley wrote:
> > There's other odd things happening. When I first load the page
> > clicking on the <a> links nothing happens, and I have to first click
> > either on the <th> area or on some link on the page ( like the ajax
> > updater for "page next", for example).
>
> Well duh!, as they say.
>
> I've got an inline onclick handler on the <a> tag and I also have
> Behaviour setup to add an onclick handler to those <a> tags -- which
> replaces the inline ones.
>
> I suppose I could (should) assign unique ids to every link where I
> need Ajax.Updater and use behaviour to do both the Event.stop and the
> Ajax.Updater for each id -- just to get the javascript out of the
> html.
>
> BTW, seems like doing:
>
> Ajax.Updater(); Event.stop(e); return false;
>
> actually somehow returns true because the browser is making both the
ajax
> and
> non-ajax request.
>
> Where just:
>
> Ajax.Updater(); return false;
>
> works ok (and when I don't have onclick on the <tr> ).
>
> Maybe I need to learn more about event order to understand why this
> isn't working.
>
> --
> Bill Moseley
> [EMAIL PROTECTED]
>
> _______________________________________________
> Rails-spinoffs mailing list
> [email protected]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs