Differences between revisions 2 and 3
Revision 2 as of 2008-05-21 16:57:17
Size: 684
Editor: joshcanfield
Comment: Added note about using template expansions
Revision 3 as of 2009-09-20 23:20:32
Size: 684
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

When you include your own JavaScript functions in a page or component, you have to take care that the formatting doesn't go awry. So I recommend you use the following approach (pay special attention to the comment tags at the start and end of the script tags):

<script type="text/javascript" language="JavaScript">
    var myValue = '${prop:value}'; // before the comment so Tapestry sees it!
<!-- //
    // Toggle the display of a set of elements between show and hide
    function toggle() {
          for ( var i=0; i < arguments.length; i++ ) {
                $(arguments[i]).style.display = ($(arguments[i]).style.display != 'none' ? 'none' : '' );
          }
    }
// -->
</script>

Tapestry5HowToIncludeJavaScript (last edited 2009-09-20 23:20:32 by localhost)