You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jesse Kuhnert <jk...@gmail.com> on 2007/08/14 04:14:09 UTC

Re: and 3rd-party javascript libraries

On your running web app copy and paste the url that is generated to
jquery and just see if you can hit it directly..  If you are
successful you'll see the javascript source code.

On 7/28/07, Chinchih <ta...@chinchih.net> wrote:
> 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: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org