Ok, so I used a javascript script in my page by referencing the external file and it worked. I did the exact same thing with another file and it wasn't loading! After scratching my head bald I've decided to switch the places of the two tags and voila! the script that worked would not load! The one that did not work previously was purring nicely.

My calls looked like this:
<script type="text/javascript" src='script1.js'/>
<script type="text/javascript" src='script2.js'/>


After scratching my skull a little more (blood was dripping already) I realized that the script tags are atomic tags, they should have no ending tag. Why would they, the content is specified in the src attribute. But on the DOM page for the script element there is an obscure line saying: Start tag: required, End tag: required. I switched to <script></script> format and it worked.

Oh, you are wondering why the first script worked? Because somehow an atomic script tag is erroneous, but it doesn't return any error. Instead it is treated like a mistyped start tag and the atomic portion of it is ignored. The second script would not load since the browser expected a script end tag. Maybe he even interpreted the second tag as an end tag for all I know.

Comments

Anonymous

<p> Anonymous said...<br>Beware xslt, you need to do something like this - substitute angle brackets for parentheses:<br>(xsl:text disable-output-escaping="yes")(![CDATA[(script type="application/javascript" src="myfile.js")(/script)]])(/xsl:text)<br><br><br>Thanks this saved my life..i was going bonkers<br><br>Siderite ...see xslt has to do with it as it causes on one script to load..so I ended up here and that post saved me hours of work..</p>

Anonymous

Anonymous

Anonymous said...<br>Beware xslt, you need to do something like this - substitute angle brackets for parentheses:<br>(xsl:text disable-output-escaping=&quot;yes&quot;)(![CDATA[(script type=&quot;application/javascript&quot; src=&quot;myfile.js&quot;)(/script)]])(/xsl:text)<br><br><br>Thanks this saved my life..i was going bonkers<br><br>Siderite ...see xslt has to do with it as it causes on one script to load..so I ended up here and that post saved me hours of work..

Anonymous

Ati

<p>i should have found your blog a week ago.. many many thanks for this piece of information!</p>

Ati

Ati

i should have found your blog a week ago.. many many thanks for this piece of information!

Ati

Anonymous

<p>Wow, this was causing us a huge headache loading javascript in a webview in our mobile app. Leaving off the end tag worked on Android Gingerbread and iOS 4, but died quietly on Android Honeycomb and iOS 5. Thanks so much!</p>

Anonymous

Anonymous

Wow, this was causing us a huge headache loading javascript in a webview in our mobile app. Leaving off the end tag worked on Android Gingerbread and iOS 4, but died quietly on Android Honeycomb and iOS 5. Thanks so much!

Anonymous

Anonymous

<p>Beware xslt, you need to do something like this - substitute angle brackets for parentheses:<br>(xsl:text disable-output-escaping="yes")(![CDATA[(script type="application/javascript" src="myfile.js")(/script)]])(/xsl:text)</p>

Anonymous

Anonymous

Beware xslt, you need to do something like this - substitute angle brackets for parentheses:<br>(xsl:text disable-output-escaping=&quot;yes&quot;)(![CDATA[(script type=&quot;application/javascript&quot; src=&quot;myfile.js&quot;)(/script)]])(/xsl:text)

Anonymous

petergun

<p>I've pulled the rest of my hair out, before I found your post.<br>It was very helpful. Thanks a lot!</p>

petergun

petergun

I&#39;ve pulled the rest of my hair out, before I found your post.<br>It was very helpful. Thanks a lot!

petergun

Siderite

<p>You are very very welcome. :)</p>

Siderite

Anonymous

<p>I have been bleeding profusely for a number of hours before you figured out what was going on for me. Thank you very very much.</p>

Anonymous

Anonymous

I have been bleeding profusely for a number of hours before you figured out what was going on for me. Thank you very very much.

Anonymous

Post a comment