Hi all, I am new to JavaScripting and have a question about element.upodate().Is there a way to have update use a text file of html file to get it''s text? I''m just getting familiar with DOM and I have not seen anything that pops out at me for the answer to that question. Any suggestions provided are greatly appreciated. Thanks, Norm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry, I should have proofed this. What I am doing is updating a <DIV> with element.update. when a user clicks on a link. I could use iframes and accomplish exactly what I want to do, but what fun would that be? =) for SEO I think updating a DIV is a much better and elegant way to do this. Norm On Oct 19, 12:37 pm, NormyB <NormanBa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I am new to JavaScripting and have a question about > element.upodate().Is there a way to have update use a text file of > html file to get it''s text? I''m just getting familiar with DOM and I > have not seen anything that pops out at me for the answer to that > question. Any suggestions provided are greatly appreciated. > > Thanks, > Norm--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
$("somelink").observe("click", function(event) { new Ajax.Updater("destination", this.href, { method: "get" }); event.stop(); }); Should work fine on 1.6+ :) On previous versions of Prototype use Event.stop(event) instead of event.stop() and Event.element(event).href instead of this.href. Best, Nicolas On 10/19/07, NormyB <NormanBauer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Sorry, I should have proofed this. > > What I am doing is updating a <DIV> with element.update. when a user > clicks on a link. > > I could use iframes and accomplish exactly what I want to do, but what > fun would that be? =) for SEO I think updating a DIV is a much better > and elegant way to do this. > > > Norm > > On Oct 19, 12:37 pm, NormyB <NormanBa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi all, > > > > I am new to JavaScripting and have a question about > > element.upodate().Is there a way to have update use a text file of > > html file to get it''s text? I''m just getting familiar with DOM and I > > have not seen anything that pops out at me for the answer to that > > question. Any suggestions provided are greatly appreciated. > > > > Thanks, > > Norm > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Nicolas, Actually all I needed was <a href="#" onclick="new Ajax.Updater(''somepage.html'', ''destination DIV'');"> my link </a> That worked like a charm. Norm On Oct 19, 2:55 pm, "Nicolás Sanguinetti" <godf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> $("somelink").observe("click", function(event) { > new Ajax.Updater("destination", this.href, { method: "get" }); > event.stop(); > > }); > > Should work fine on 1.6+ :) > On previous versions of Prototype use Event.stop(event) instead of > event.stop() and Event.element(event).href instead of this.href. > > Best, > Nicolas > > On 10/19/07, NormyB <NormanBa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Sorry, I should have proofed this. > > > What I am doing is updating a <DIV> with element.update. when a user > > clicks on a link. > > > I could use iframes and accomplish exactly what I want to do, but what > > fun would that be? =) for SEO I think updating a DIV is a much better > > and elegant way to do this. > > > Norm > > > On Oct 19, 12:37 pm, NormyB <NormanBa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi all, > > > > I am new to JavaScripting and have a question about > > > element.upodate().Is there a way to have update use a text file of > > > html file to get it''s text? I''m just getting familiar with DOM and I > > > have not seen anything that pops out at me for the answer to that > > > question. Any suggestions provided are greatly appreciated. > > > > Thanks, > > > Norm--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah, that works, but if the user doesn''t have javascript enabled, or desires to open the link in a new tab, he can''t :) Best, Nicolas On 10/22/07, NormyB <NormanBauer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Thanks Nicolas, > > Actually all I needed was > > <a href="#" onclick="new Ajax.Updater(''somepage.html'', ''destination > DIV'');"> my link </a> > > That worked like a charm. > > Norm > > On Oct 19, 2:55 pm, "Nicolás Sanguinetti" <godf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > $("somelink").observe("click", function(event) { > > new Ajax.Updater("destination", this.href, { method: "get" }); > > event.stop(); > > > > }); > > > > Should work fine on 1.6+ :) > > On previous versions of Prototype use Event.stop(event) instead of > > event.stop() and Event.element(event).href instead of this.href. > > > > Best, > > Nicolas > > > > On 10/19/07, NormyB <NormanBa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Sorry, I should have proofed this. > > > > > What I am doing is updating a <DIV> with element.update. when a user > > > clicks on a link. > > > > > I could use iframes and accomplish exactly what I want to do, but what > > > fun would that be? =) for SEO I think updating a DIV is a much better > > > and elegant way to do this. > > > > > Norm > > > > > On Oct 19, 12:37 pm, NormyB <NormanBa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi all, > > > > > > I am new to JavaScripting and have a question about > > > > element.upodate().Is there a way to have update use a text file of > > > > html file to get it''s text? I''m just getting familiar with DOM and I > > > > have not seen anything that pops out at me for the answer to that > > > > question. Any suggestions provided are greatly appreciated. > > > > > > Thanks, > > > > Norm > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---