Javascript - inline and external

X-Application Version: 4.1.1
Tamino Version : 4.1.1
Platform : Win2k
WebContainer : Tomcat 4.1.1
JDK Version : 1.4.1


I use IE 5.5 and my colleague IE 6.0. In my browser a page with a element which references an external javasript for instance anim.js works 100%. In the IE 6.0 it shows a blank page, but if I move the same script code to be ‘inline’ i.e. part of the script tag in the page, it also works for IE 6.0.

Why is this? Is there a setting in the browser we can set?

It is really limiting not to be able to reference external javascript files.

Elsabe Jacobs

It seems that Internet Explorer 6 insists on a certain format of script tag, like this:

<script language="JavaScript" src="<url to your script>"></script>

Does this help? If not, can you please post the lines you are changing, before and after the change. Finally, is there any information in the browser status bar at the bottom left corner when you get your empty page?
Hope this helps.

Thank you very much for the response!

The problem was that I had an empty tag i.e. I closed it in the same tag that it was opened. For example

<script language="JavaScript" src="<url to your script>"/></pre><BR><BR>But if you do it as you suggested <BR><pre class="ip-ubbcode-code-pre"> <script language="JavaScript" src="<url to your script>"></script> 

it works.


Hi again

To get the basics.xsl to generate the correct tag I had to change it from

  <script language="JavaScript" src="anim.js" type="text/javascript">
 </pre><BR><BR>to <BR><BR><pre class="ip-ubbcode-code-pre"><script language="JavaScript" src="anim.js" type="text/javascript">
<!-- need to put this blank space in otherwise the script tag is created as an empty element
     and the IE 6 browser does not show the page  -->
		<xsl:text> </xsl:text>

This forces a space as the value of the element and prevents the stylesheet processor from creating an empty element.

This works 100% but is there a better way of achieving this?