I have a question about how the <include-script> tag in script templates is used
to include 3rd-party javascript libraries? According to Tapestry 4.x online User
Guide, the required "resource-path" attribute specifies "The path to the script
within the classpath."

I tagged onto the "ConfirmDelete" example in ch.10 of "Enjoying Web Deveopment
with Tapestry, 3ed" and added the following line in Confirm.script, just below
<script>:

<include-script resource-path="js/jquery-latest.pack.js"/>

And inside the <body> block, I used a jQuery function just for testing. After
deploying the example, "view source" revealed that Tapestry had generated the
following:

<body id="Body">
<script type="text/javascript"
src="/ConfirmDelete/WEB-INF/js/jquery-latest.pack.js"></script>
<script type="text/javascript"><!--
function getConfirmation() {
return confirm("Are you sure?");
}
$(function(){
$('button').bind('click', getConfirmation);
});
// --></script>
...

But on page load I'm getting an error in Firebug which indicated that the page
couldn't reference the jquery library. I have tried to put
"jquery-latest.pack.js" under WEB-INF/js inside the war file, but that didn't
work. Then I tried to create a "jslib.jar", which contains
js/jquery-latest.pack.js and put it under WEB-INF/lib. That didn't work, either.
Could someone please kindly offer some hint?

Thanks,
Chinchih


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to