I''m having a hard time calling effects from inside a page I AJAX''d in. I even linked the javascript files in the other page and I still can''t do it from that page. Is there something I''m doing wrong? My AJAX call: Ajax.Updater(''pagewrapper'', ''pagelayout.html''); My effect call inside pagelayout.html: Effect.SlideDown(''navslider'', {duration:3}); For the record, no I did not misspell the div I''m wanting to apply the effect to. Thanks in advance! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey Jonathan, Jonathon Davis a écrit :> My AJAX call: Ajax.Updater(''pagewrapper'', ''pagelayout.html'');So I assume your HTML is actually an HTML *fragment*, right? Something that legally fits inside that "pagewrapper" <div>, hmmm? Now: 1) does your original page (the one you''re AJAX''ing from) contain a loaded script.aculo.us script? 2) does your pagelayout.html wrap the effect call in a <script> tag? 3) do you use "new Effect.Blah" instead of "Effect.Blah" (cleaner)? 4) Does that script fragment appear *after* the HTML that defines the "navslider"-ID''d element? 5) And the kicker, your actual problem: add evalScripts: true to your Updater''s options: new Ajax.Updater(''pagewrapper'', ''pagelayout.html'', { method: ''get'', evalScripts: true }); (Since you''re fetching a static HTML fragment, GET is preferable to the default POST, btw). Cheers, -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Oh ok, you see I knew I was missing a parameter but I checked the Prototype docs and I didn''t see it there. I had everything right except for the evalScripts: true. Thanks On Feb 15, 5:18 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey Jonathan, > > Jonathon Davis a écrit : > > > My AJAX call: Ajax.Updater(''pagewrapper'', ''pagelayout.html''); > > So I assume your HTML is actually an HTML *fragment*, right? Something > that legally fits inside that "pagewrapper" <div>, hmmm? > > Now: > > 1) does your original page (the one you''re AJAX''ing from) contain a > loaded script.aculo.us script? > 2) does your pagelayout.html wrap the effect call in a <script> tag? > 3) do you use "new Effect.Blah" instead of "Effect.Blah" (cleaner)? > 4) Does that script fragment appear *after* the HTML that defines the > "navslider"-ID''d element? > 5) And the kicker, your actual problem: add evalScripts: true to your > Updater''s options: > > new Ajax.Updater(''pagewrapper'', ''pagelayout.html'', { > method: ''get'', evalScripts: true }); > > (Since you''re fetching a static HTML fragment, GET is preferable to the > default POST, btw). > > Cheers, > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I have another problem now, though. The effects work great now but using them breaks my navigation link bar. It looks the same as before, except my CSS-based rollover background changes and font color changes aren''t clickable. To see what I mean go to my test site: http://jon.nexthack.com/og/ and just press Login on the dialog. As you hover the links the background of that section should change and the text should go to a lighter color. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jonathon Davis a écrit :> Oh ok, you see I knew I was missing a parameter but I checked the > Prototype docs and I didn''t see it there. I had everything right > except for the evalScripts: true.http://prototypejs.org/api/ajax/updater Right there ;-) -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jonathon Davis a écrit :> I have another problem now, though.Yeah: you throw HTML and CSS to the wind. Your UI structure does not lend itself too well to AJAX (and your layout clearly has issues), but that''s not the issue here. The core of your issue is that your loginwrapper div takes the whole viewport: it acts as a "glasspane" over the remainder of the UI (your pagewrapper div), intercepting hovers, clicks, and the like. Firebug inspection show so right away. Second, the HTML you get back and put in the DIV is weird: <title>, <link>... This is all <head> stuff, it shouldn''t quite be in a <div>. You can fix the fundamental issue by better styling your stuff: there should be no loginwrapper div: use a "modal" dialog box like the Prototype Window Class lib to achieve the same effect while retainining a single wrapper behind (you may even not need the wrapper at all, then, and use the body directly). Aside from this, you should reconsider your content architecture (division, layout, tags in there) to fix semantic issues (and make it strict, so you don''t have to tinker with QuirksMode in most browsers). When you have time, also make your JS unobstrusive, that would be nice. -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 so much! I got the Prototype Window Class lib working on it (although I haven''t uploaded it yet.) I plan on fixing the styling issues you mentioned when I have some more time to work on that part of it, and also making my JS unobstructive. You have to bear with me, I''m not very fluent with Javascript, but I''m catching on. On Feb 15, 11:25 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Jonathon Davis a écrit : > > > I have another problem now, though. > > Yeah: you throw HTML and CSS to the wind. > > Your UI structure does not lend itself too well to AJAX (and your layout > clearly has issues), but that''s not the issue here. > > The core of your issue is that your loginwrapper div takes the whole > viewport: it acts as a "glasspane" over the remainder of the UI (your > pagewrapper div), intercepting hovers, clicks, and the like. Firebug > inspection show so right away. > > Second, the HTML you get back and put in the DIV is weird: <title>, > <link>... This is all <head> stuff, it shouldn''t quite be in a <div>. > > You can fix the fundamental issue by better styling your stuff: there > should be no loginwrapper div: use a "modal" dialog box like the > Prototype Window Class lib to achieve the same effect while retainining > a single wrapper behind (you may even not need the wrapper at all, then, > and use the body directly). > > Aside from this, you should reconsider your content architecture > (division, layout, tags in there) to fix semantic issues (and make it > strict, so you don''t have to tinker with QuirksMode in most browsers). > When you have time, also make your JS unobstrusive, that would be nice. > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---