cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Schmitz <>
Subject RE: javascript embedded in *.jx files
Date Thu, 09 Oct 2008 15:19:07 GMT
Ahhhhhh, now I get it.  I just didn't follow through with my thinking since that part kind
of happens "under the covers".  It's just like css and images are served by cocoon.

Actually, it would have worked had I used the scripts folder to hold my script instead of
creating a new 'javascripts' folder, since the cocoon default sitemap has:

     <!-- JavaScript scripts -->
    <map:match pattern="scripts/*.js">
      <map:read mime-type="text/javascript" src="resources/scripts/{1}.js"/>

But then, I would never have learned what's really going on.

Anyway, thanks for the great explanations and for your patience in spoon feeding me the info.
 Now I just hope this message doesn't get posted 6 times like my other ones have been :-)


On Wednesday, October 08, 2008, at 01:30AM, "Derek Hohls" <> wrote:
>Not that strange when you consider what is happening.
>In your web page you have the entry src="js/myPageScript.js"
>This essentially becomes a request to the server to find and return
>data from the "js/myPageScript.js" URI.  The web server in turn passes
>that request through to the application - in this case, Cocoon - which
>must be able to handle it.  Cocoon's primary "decision handling" framework
>is the sitemap.  So every request, or type of request, that Cocoon is 
>going to get must have a corresponding entry somewhere in it.
>In short, the answer is "yes"!
>>>> On 2008/10/07 at 09:57, in message <>,
Jeff Schmitz <> wrote:
>Hmmm, that seems strange to me.  Note that I really just the <script> tag, which
is part of the *.jx page, to just passed through as is and become part of the html page to
be returned.  I don't want the actuall javascript file to become part of the returned page.
 I didn't expect to have to create a match for the src attribute of my script tag.
>e.g. I may have a myPage.jx file with the following tag:
><script type="text/javascript" src="js/myPageScript.js>
>For this case, do I need a match in my sitemap for myPageScript.js?
>On Tuesday, October 07, 2008, at 01:49PM, "Jasha Joachimsthal" <>
>>-----Original Message-----
>>From: Jeff Schmitz [] 
>>Sent: Tue 10/7/2008 17:32
>>Subject: Re: javascript embedded in *.jx files
>>> > Really, external scripts aren't working for you?  Why not?
>>> I think the main reason was I couldn't figure out how to  correctly point to
where the script was.  I kept getting file not found errors in the output.
>>Is there a matcher in your sitemap for the javascript file. Something like
>><map:match pattern="*.js"> <!-- request for myscript.js or myscript1.js -->
>><map:read src="js/{1}.js"/> <!-- actual script is located inside the js directory
>This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice,
and implemented Open Document Format (ODF) standard. 
>The full disclaimer details can be found at
>This message has been scanned for viruses and dangerous content by MailScanner, 
>and is believed to be clean.  MailScanner thanks Transtec Computers for their support.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message