On Mar 25, 5:55 pm, "Fabian Lange" <[EMAIL PROTECTED]> wrote: > Hi, > does this really belong to the developers list? > Lets try to bend it here :-)
I think you made a successful attempt ;-) > I wonder if that is a good idea. Sure it helps, but this solution always > moves all the javascripts to bottom. What about code that needs the script > to appear before the bottom? > Even if not used directly, what about code that triggers on click and on > mouseover? Hmm, all my JavaScript code is built on Dean Edwards' base2 library (http://code.google.com/p/base2/) and all objects that require the DOM to be loaded are wrapped in an eventListener that is fired when the DOM is loaded. I can imagine problems occurring in some cases where you try to instantiate JavaScript objects in page-embedded JavaScript that is not yet defined, or does getJavascript() fetch the inline JavaScript as well? Maybe you could provide a small example to explain you click and mouseover example cause I am not exactly sure about what type of code you are talking about (I don't use prototype and I'm have no knowledge of its structure...) > The only feasible solution I see is that you need the possibility to tag you > javascripts. Those you know which can be safely put to the bottom of the > page. Well that would indeed be great. Let's make it even better, a function to merge the files into one external JavaScript file:-D > Especially as performance gets an issue at the end of a project, not at the > beginning it will be very hard to make it possible to move ALL scripts to > bottom. > > So +1 for adding an option to control via yml or addJavascript() where the > script should go. Personally I think this is something that shouldn't be handled by YML configuration because it may differ from script to script from page to page (i.e. on constraints may differ from page to page) > > .: Fabian > > -----Original Message----- > From: > > [EMAIL PROTECTED] > om > [mailto:[EMAIL PROTECTED] > groups.com] On Behalf Of Michel Weimerskirch > Sent: Dienstag, 25. März 2008 17:35 > To: [email protected] > Subject: [symfony-devs] Re: Front end optimization: Adding javascripts on > the bottom of the page > > You can just put the following at the end of your > apps/myapp/template/layout.php (right before </body>): > <?php echo get_javascripts() ?> > There is no need for a partial, nor to remove existing javascripts. > > Michel > > On 3/25/08, Marijn <[EMAIL PROTECTED]> wrote: > > > So I could just add some PHP code in a partial that would be included > > on the bottom of every template. The parial would first call > > get_javascripts and then delete all javascripts from the sfResponse > > object..? > > > Thanks for your quick reply. > > > Marijn > > > On Mar 25, 4:56 pm, Robert Speer <[EMAIL PROTECTED]> wrote: > > > try get_javascripts () > > > > the api is easiest to search here:http://www.gotapi.com/symfony > > > > On Mar 25, 10:18 am, Marijn <[EMAIL PROTECTED]> wrote: > > > > > Hi everybody, > > > > > I think this is question belongs in the developer list, if not please > > > > be kind enough to tell me ;-) > > > > > Currently Symfony adds javascripts in the head tag of the page but I > > > > prefer to put them on the bottom of the page for faster rendering > > > > content on the page. For more information about that you can check > out > > > > this link from Yahoo on front-end > optimizationhttp://developer.yahoo.com/performance/rules.html#js_bottom(pret > ty > > > > useful I'd say). > > > > > Is this something that can be considered as an option within symfony > > > > or do I need to hack my way through this. If so where to start..? A > > > > quick peek at the source didn't result in to much insight on the > > > > addJavascript function. > > > > > Thanks, > > > > > Marijn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---
