As has already been pointed out, this is incorrect behaviour of Internet
Explorer. The short form <script ... /> is not valid xhtml. You have to
use <script ... > </script>. HTML is much more tolerant. IE gets
confused between xhtml and HTML.
I had a particular problem with the JavaScript files belonging to Cocoon
forms, which use the short form. I did not feel confident to rewrite them,
so I had to insert an XSLT transformation into my pipeline.
<xsl:template match="script">
<xsl:element xmlns="http://www.w3.org/1999/xhtml"
name="{local-name()}">
<xsl:apply-templates select="*|@*|text()"/>
<xsl:if test="not(string(.))"> </xsl:if>
</xsl:element>
</xsl:template>
HTH
Robin
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 15 September 2007 16:30
To: [email protected]
Subject: Re: Javascript Source File can not be directly loaded
Just in this case Felix...
This proposed solution won´t work for me...
Its weird, when i try to include a second javascript(first script file is on
other place migrated to use at least one), so it happens that this javscript
wont work. For example, i cannot get access to functions or variables within
this source file... Its like as that they script file never be exist.
What a scary Saturday :D
Felix Knecht wrote:
> [EMAIL PROTECTED] schrieb:
>> Hi there, i´ve since a few days much more problems with Javascript
>> and Cocoon then ever...
...
>>
>> Example(in this case there is in test.js a function named "test"
>> and within of them an alert invocation ):
>>
>> <xsl:template match="body">
>>
>> <body> <script src="test/test.js" language="Javascript"/>
>> <script>test();</script> </body>
>
> I had simular problems. What helped in my case was to have a starting
> and ending tag for script like
>
> <body> <script src="test/test.js" language="Javascript"> <!-- Dummy
> text --> </script> <script>test();</script> </body>
Yes, that's exactly it; Internet Explorer in particular will ignore
everything after a <script> tag if it is not closed with a </script>
tag. Using the XML-style closing <script/> will not work.
http://www.phpied.com/ie-script-tag-problem/
Please note this has nothing to do with Cocoon in particular but is
simply a browser issue.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]