I''m working again on unloading events before making my ajax call. This code works on Firefox/Opera, but IE doesn''t seem to get the onclick events registered. Could someone with IE take a look? http://hank.org/demos/ajax3.html The js is included in that file. There''s alerts() to show when the events are registered. The idea of the code is to look for any elements with a "ajaxtarget" class, and then adds events for all children that have a class of "ajax". <div id="target" class="ajaxtarget"> <ul class="navlist"> <li><a href="future3" class="ajax">future</a></li> <li><a href="recent3" class="ajax">recent</a></li> <li><a href="past3" class="ajax">past</a></li> </ul> <p>here''s some content</p> </div> So in this example, three events are registered. And onclick the events are unloaded, and Ajax.Updater is called to replace the content in "target" And onComplete isused to reset target''s onclick events. What am I doing wrong so that IE doesn''t see the events? -- Bill Moseley moseley-kv6DSSSScSo@public.gmane.org
IE is loading the page in the ''href''. Not sure there''s a way to prevent that. Greg> -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org[mailto:rails-spinoffs-> bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Bill Moseley > Sent: Monday, April 03, 2006 1:49 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: [Rails-spinoffs] Event.observe on IE > > > I''m working again on unloading events before making my ajax call. > > > This code works on Firefox/Opera, but IE doesn''t seem to get the > onclick events registered. Could someone with IE take a look? > > http://hank.org/demos/ajax3.html > > The js is included in that file. There''s alerts() to show when the > events are registered. > > > The idea of the code is to look for any elements with a "ajaxtarget" > class, and then adds events for all children that have a class of > "ajax". > > <div id="target" class="ajaxtarget"> > > <ul class="navlist"> > <li><a href="future3" class="ajax">future</a></li> > <li><a href="recent3" class="ajax">recent</a></li> > <li><a href="past3" class="ajax">past</a></li> > </ul> > > <p>here''s some content</p> > > </div> > > So in this example, three events are registered. And onclick the > events are unloaded, and Ajax.Updater is called to replace the content > in "target" > > And onComplete isused to reset target''s onclick events. > > What am I doing wrong so that IE doesn''t see the events? > > > > -- > Bill Moseley > moseley-kv6DSSSScSo@public.gmane.org > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On 4/3/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote:> IE is loading the page in the ''href''. Not sure there''s a way to prevent > that.Return false from the onclick event. Todd
On Mon, Apr 03, 2006 at 03:41:21PM -0500, Todd Ross wrote:> On 4/3/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote: > > IE is loading the page in the ''href''. Not sure there''s a way to prevent > > that.That''s because it doesn''t seem to be running the event code at all.> Return false from the onclick event.Or set event.preventDefault(); as I''m doing. But I don''t think that''s related to the problem I''m having. -- Bill Moseley moseley-kv6DSSSScSo@public.gmane.org
I am looking to execute some javascript after the inPlace editor has executed. That is I want to execute a script on my server side as the result of enterin gtext. I added evalscripts to the inPlaceEditor call, but did not get a response. Is this possible? Deco
preventDefault() doesn't work in IE, you'd need to do "return false" which is wrapped nicely in Prototype. I think you could replace: "if ( event.preventDefault ) event.preventDefault();" with: "Event.stop(event);" ? On 4/3/06, Bill Moseley <moseley@hank.org> wrote:> > On Mon, Apr 03, 2006 at 03:41:21PM -0500, Todd Ross wrote: > > On 4/3/06, Gregory Hill <Gregory_Hill@tni.com> wrote: > > > IE is loading the page in the 'href'. Not sure there's a way to > prevent > > > that. > > That's because it doesn't seem to be running the event code at all. > > > > Return false from the onclick event. > > Or set event.preventDefault(); as I'm doing. But I don't think > that's related to the problem I'm having. > > -- > Bill Moseley > moseley@hank.org > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs