You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Jürgen Avian <ju...@gmail.com> on 2006/01/02 00:00:14 UTC

Javascript-code doesn't appear in html file

Hi!

A friend of mine told me to address this issue to Simon Kitching:

I've added some javascript code to my jspx source file like this:

...
<t:div id="tabbody" forceId="true" forceIdIndex="true">
<script type="text/javascript">
    <!--
        function testHello ()
        {
             alert ("Hello");
        }
    //-->
</script>
    <table styleClass="outerTable" style="height:417;" width="720 px">
        <tr>
          ....

This script is not displayed in the generated html-file. All you see is:
... <script type="text/javascript"><!--

//--></script><table .....

Am I wrong if I suppose the script-code to be showed in the html-file?
The html-page is generated out of several jspx files which are
combined together via tiles.
Do I have to use some special tags or is there a problem with the htmlparser?

Regards, Jürgen

Re: Javascript-code doesn't appear in html file

Posted by Jürgen Avian <ju...@gmail.com>.
Thanks!

I'll deal with this issue if I have time! Meanwhile I use the src
attribute of the script tag ...

Regards

2006/1/2, Martin Marinschek <ma...@gmail.com>:
> Jürgen has tried with f:verbatim - tags - he misses the output, still.
>
> I was the friend telling him to address that to you, by the way ;)
>
> regards,
>
> Martin
>
> On 1/2/06, Simon Kitching <sk...@apache.org> wrote:
> > On Mon, 2006-01-02 at 00:00 +0100, Jürgen Avian wrote:
> > > Hi!
> > >
> > > A friend of mine told me to address this issue to Simon Kitching:
> > >
> > > I've added some javascript code to my jspx source file like this:
> > >
> > > ...
> > > <t:div id="tabbody" forceId="true" forceIdIndex="true">
> > > <script type="text/javascript">
> > >     <!--
> > >         function testHello ()
> > >         {
> > >              alert ("Hello");
> > >         }
> > >     //-->
> > > </script>
> > >     <table styleClass="outerTable" style="height:417;" width="720 px">
> > >         <tr>
> > >           ....
> > >
> > > This script is not displayed in the generated html-file. All you see is:
> > > ... <script type="text/javascript"><!--
> > >
> > > //--></script><table .....
> > >
> > > Am I wrong if I suppose the script-code to be showed in the html-file?
> > > The html-page is generated out of several jspx files which are
> > > combined together via tiles.
> > > Do I have to use some special tags or is there a problem with the htmlparser?
> >
> > I doubt the problem is with the ReducedHtmlParser class. If that class
> > was getting confused by the input, then it could potentially hang, or
> > might report back incorrect offsets to its caller, resulting in
> > script/stylesheet/etc references inserted by Tomahawk components being
> > inserted into wrong locations in the generated page. However I can't
> > imagine any scenario where the ReducedHtmlParser would cause output to
> > be *lost*; it just reports back offset values to its caller.
> >
> > There is a known JSF1.1/Tiles issue where your output will typically be
> > output *after* all JSF-generated content in the same file, so I would
> > expect to see a <div></div> output by the t:div JSF tag, with the script
> > output *later* in the page. However it should still be there. The reason
> > for this is described on the wiki, and the usual fix is to wrap all
> > non-JSF output in an <f:verbatim> tag.
> >
> > If your script code is really not appearing *at all* then you have some
> > other problem, and I'm not sure what that would be.
> >
> > By the way, this sort of question should be sent to the user list, not
> > the development list.
> >
> > Regards,
> >
> > Simon
> >
> >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: Javascript-code doesn't appear in html file

Posted by Martin Marinschek <ma...@gmail.com>.
Jürgen has tried with f:verbatim - tags - he misses the output, still.

I was the friend telling him to address that to you, by the way ;)

regards,

Martin

On 1/2/06, Simon Kitching <sk...@apache.org> wrote:
> On Mon, 2006-01-02 at 00:00 +0100, Jürgen Avian wrote:
> > Hi!
> >
> > A friend of mine told me to address this issue to Simon Kitching:
> >
> > I've added some javascript code to my jspx source file like this:
> >
> > ...
> > <t:div id="tabbody" forceId="true" forceIdIndex="true">
> > <script type="text/javascript">
> >     <!--
> >         function testHello ()
> >         {
> >              alert ("Hello");
> >         }
> >     //-->
> > </script>
> >     <table styleClass="outerTable" style="height:417;" width="720 px">
> >         <tr>
> >           ....
> >
> > This script is not displayed in the generated html-file. All you see is:
> > ... <script type="text/javascript"><!--
> >
> > //--></script><table .....
> >
> > Am I wrong if I suppose the script-code to be showed in the html-file?
> > The html-page is generated out of several jspx files which are
> > combined together via tiles.
> > Do I have to use some special tags or is there a problem with the htmlparser?
>
> I doubt the problem is with the ReducedHtmlParser class. If that class
> was getting confused by the input, then it could potentially hang, or
> might report back incorrect offsets to its caller, resulting in
> script/stylesheet/etc references inserted by Tomahawk components being
> inserted into wrong locations in the generated page. However I can't
> imagine any scenario where the ReducedHtmlParser would cause output to
> be *lost*; it just reports back offset values to its caller.
>
> There is a known JSF1.1/Tiles issue where your output will typically be
> output *after* all JSF-generated content in the same file, so I would
> expect to see a <div></div> output by the t:div JSF tag, with the script
> output *later* in the page. However it should still be there. The reason
> for this is described on the wiki, and the usual fix is to wrap all
> non-JSF output in an <f:verbatim> tag.
>
> If your script code is really not appearing *at all* then you have some
> other problem, and I'm not sure what that would be.
>
> By the way, this sort of question should be sent to the user list, not
> the development list.
>
> Regards,
>
> Simon
>
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Javascript-code doesn't appear in html file

Posted by Simon Kitching <sk...@apache.org>.
On Mon, 2006-01-02 at 00:00 +0100, Jürgen Avian wrote:
> Hi!
> 
> A friend of mine told me to address this issue to Simon Kitching:
> 
> I've added some javascript code to my jspx source file like this:
> 
> ...
> <t:div id="tabbody" forceId="true" forceIdIndex="true">
> <script type="text/javascript">
>     <!--
>         function testHello ()
>         {
>              alert ("Hello");
>         }
>     //-->
> </script>
>     <table styleClass="outerTable" style="height:417;" width="720 px">
>         <tr>
>           ....
> 
> This script is not displayed in the generated html-file. All you see is:
> ... <script type="text/javascript"><!--
> 
> //--></script><table .....
> 
> Am I wrong if I suppose the script-code to be showed in the html-file?
> The html-page is generated out of several jspx files which are
> combined together via tiles.
> Do I have to use some special tags or is there a problem with the htmlparser?

I doubt the problem is with the ReducedHtmlParser class. If that class
was getting confused by the input, then it could potentially hang, or
might report back incorrect offsets to its caller, resulting in
script/stylesheet/etc references inserted by Tomahawk components being
inserted into wrong locations in the generated page. However I can't
imagine any scenario where the ReducedHtmlParser would cause output to
be *lost*; it just reports back offset values to its caller.

There is a known JSF1.1/Tiles issue where your output will typically be
output *after* all JSF-generated content in the same file, so I would
expect to see a <div></div> output by the t:div JSF tag, with the script
output *later* in the page. However it should still be there. The reason
for this is described on the wiki, and the usual fix is to wrap all
non-JSF output in an <f:verbatim> tag.

If your script code is really not appearing *at all* then you have some
other problem, and I'm not sure what that would be.

By the way, this sort of question should be sent to the user list, not
the development list.

Regards,

Simon