You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Onno Scheffers <on...@piraya.nl> on 2008/10/04 13:32:21 UTC
Re: Javascript at the bottom of page
Hi Howard,
including Javascript files at the end of the page may increase page-load
times, but for me it introduces an unwanted usability issue.
I am rendering a couple of questions on a single page and answering them
should work for the user without Javascript. If Javascript is enabled, I
want to enhance the user-experience by hiding some area to better focus the
attention of the user on the important parts.
If I add my collapse-script using the @IncludeJavaScriptLibrary annotation,
the page is displayed in the browser and then you _see_ the areas being
collapsed. If the js-files are included in the head-section of the page,
they are loaded first and the areas are collapsed _before_ the browser gets
a chance to render them.
Currently I include my custom Javascript in the Head of the template to work
around this issue, but this means I cannot use the Prototype library since
it was not yet included.
It would really help if at least the Prototype/script.aculo.us libraries can
be configured to be included in the head-section.
regards,
Onno
On Tue, Sep 2, 2008 at 9:25 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
> The correct solution is to NOT use <script> blocks in your code, but
> make use of the RenderSupport environmental.
>
> These things will NOT be made configurable, because that just opens us
> up to a series of issues along the lines of "why doesn't this
> component work as part of an Ajax partial render?".
>
> On Sun, Aug 31, 2008 at 11:48 AM, samlai <sy...@gmail.com> wrote:
> >
> > I have similar problem and the workaround works but it's kind of ugly.
> >
> > In my case, my embedded <script> depends on protoype.js and
> > scriptaculous.js, so I do the workaround and include the those JavaScript
> > files in the html head section via tapestry template.
> >
> > The problem is that same page contains components that have implicit
> > dependencies on protoype.js and scriptaculous.js as well. I believe it's
> > either standard T5 datetime field or some T5-components that I used is
> doing
> > @IncludeJavaScriptLibrary on protoype.js and scriptaculous.js. Anyways,
> it
> > ended up my embedded script works fine, but I have extra protoype.js and
> > scriptaculous.js included at the bottom of the page.
> >
> > If there anyway to specified that I've already manually include those
> > javascripts and not to duplicate include them at the bottom?
> >
> > If it's not too much trouble, I'd appreciate having JavaScript at bottom
> to
> > be configurable.
> > --
> > View this message in context:
> http://www.nabble.com/Javascript-at-the-bottom-of-page-tp18152871p19244950.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator Apache Tapestry and Apache HiveMind
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>