You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by George Singer <gs...@lincoln.ac.uk> on 2004/07/28 11:27:41 UTC
Problem using an External Javascript file (My FIRST question ... so I hope someone can help !)
************************************************************************************
Problem using an External Javascript file in an XSL stylesheet (My FIRST question ... hope someone can help !)
************************************************************************************
The xsl fragment below, shows a simple bit of inline javascript, which works fine (when commenting tags are removed ).
HOWEVER, when I try to put the inline stuff inside an external file (add.js in this case), the file is ignored.
I've searched around, some people suggest adding a space using:
<script language="JavaScript" type="text/javascript" src="add.js"> </script>
Others suggest defining an entity (with <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " ">]> using in place of  )
Others suggest replacing the   with <xsl:comment>no inline script</xsl:comment>
I've tried all these, with no success.
Hopefully this problem will get a solution
regards
GeorgeS
<head>
<title>
<xsl:value-of select="title"/>
</title>
<!--<script type="text/javascript">
// this function uses the DOM to bring focus to the Shirt_Number textbox:
function start(){
document.forms['form1'].elements['Shirt_Number'].focus()
}
// this function uses the DOM to highlight the form text boxes:
function highlight(set){
set.style.backgroundColor="yellow";
}
// this function uses the DOM to remove highlight from the form text boxes:
function dehighlight(set){
set.style.backgroundColor="white";
}
</script>-->
<link rel="stylesheet" href="{$contextPath}/styles/main.css" title="Default Style"/>
<style type="text/css">body {background-color: #ffffcc; color: navy;} b.red {color:red;}</style>
<script language="JavaScript" type="text/javascript" src="add.js"></script>
</head>
<body onload="start()">
:
Re: Problem using an External Javascript file (My FIRST question
... so I hope someone can help !)
Posted by "Volkm@r" <pl...@arcor.de>.
George Singer wrote:
> ************************************************************************************
> Problem using an External Javascript file in an XSL stylesheet (My FIRST question ... hope someone can help !)
> ************************************************************************************
>
> The xsl fragment below, shows a simple bit of inline javascript, which works fine (when commenting tags are removed ).
>
> HOWEVER, when I try to put the inline stuff inside an external file (add.js in this case), the file is ignored.
What does that mean? Is "add.js" supplied by Cocoon and can you display
it in your browser?
If not, are you using a reader for supplying "add.js" like
<map:match pattern="**.js">
<map:read mime-type="text/javascript src="{1}.js"/>
</map:match>
>
> I've searched around, some people suggest adding a space using:
>
> <script language="JavaScript" type="text/javascript" src="add.js"> </script>
Why?
>
> // this function uses the DOM to bring focus to the Shirt_Number textbox:
Why don't you use tabindex attribute?
--
Volkmar W. Pogatzki
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org