myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jörn Zaefferer" <joern.zaeffe...@googlemail.com>
Subject Re: how to use a javascript source in a component
Date Wed, 07 Mar 2007 21:14:25 GMT
On 3/7/07, Simon Kitching <simon.kitching@rhe.co.nz> wrote:

> Some browsers allow them in
> the BODY but that is not actually valid html.
>

That isn't true either. The spec says:
"The SCRIPT <http://www.w3.org/TR/html4/interact/scripts.html#edef-SCRIPT>element
places a script within a document. This element may appear any
number of times in the
HEAD<http://www.w3.org/TR/html4/struct/global.html#edef-HEAD>or
BODY <http://www.w3.org/TR/html4/struct/global.html#edef-BODY> of an HTML
document."

So as long as you don't worry about readable markup (JSF isn't famous for
that anyway), you can just put your scripts into the body.

The best solution would concatenate all scripts used on one page into one
single file, put in the head of the page. The overhead of a few more lines
of code then actually necessary on the current page is compensated through
the reduced overhead of the reduced number of requests.

Mime
View raw message