For the last week or so, I\'ve been fighting to make Internet Explorer (v6) display the content of a page I\'ve been designing for a while, after testing generally in Firefox with no problems, I came to check in IE, only to find I had -no- page content.
This was strange, as my body background-image still loaded, however I knew IE wasn\'t rendering the markup past the body tag, though it\'d still parse the actual body tag alone.
Now, once I\'d realised this, I knew it had to be something within the markup, more specifically the HEAD section. Having recently included a <script> tag, this quickly became the suspect.
Unfortunately, and possibly naively, I\'d imagined that the <script> tag, if referencing an external script file, should be self-closed, right? Wrong.
an example code would be:
[code]<script type="text/javascript" url="http://www.example.com/foo.bar" />[/code]
To me, that\'d appear as valid XHTML, as there\'s no need for anything within the script tags when referencing it externally.. though, a good lesson learned here, the solution is to always ensure there\'s a closing script tag.
Hence the solution is/was:
[code]<script type="text/javascript" url="http://www.example.com/foo.bar"></script>[/code]
Strange, really. Firefox will choose to render this anomaly correctly, gotta love IE!
Careful with Script Tags in Internet Explorer
Moderators: Moderator, Global Moderator
Careful with Script Tags in Internet Explorer
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <-
poor class
[18:09:00] * ~Moppy stews ner0 erotically 1 times.
[18:09:00] * ~Moppy stews ner0 erotically 1 times.
Careful with Script Tags in Internet Explorer
If I am correct, that problem is not because of internet explorers lack of standards compatibility... javascript itself does not support self closing tags and as far as im aware, the W3C standards do not say that script tags should self close... in fact if they did self close i would see that as possibly problematic because javascript unlike CSS does not rely on single injection methods (as in CSS file goes HERE)
the problem is that most tags can self close because they are simply required to insert themselves into a document without assigning themselves to a multiple elements... javascript however requires the ability to add script tags inside the body as well as the head... if self closing occured you would be unable to specify how much of your document the Script applies to.
the problem is that most tags can self close because they are simply required to insert themselves into a document without assigning themselves to a multiple elements... javascript however requires the ability to add script tags inside the body as well as the head... if self closing occured you would be unable to specify how much of your document the Script applies to.
Last edited by Alexander on Sat Mar 10, 2007 1:37 pm, edited 1 time in total.
Careful with Script Tags in Internet Explorer
good point alex. I never really use javascript. But every time i have used it i always closed with </script>
Careful with Script Tags in Internet Explorer
I tend to steer away from javascript. It\'s an evil thing I hate using; sometimes I have to though. <img src=\'http://www.killanet.net/forum3/public/s ... #>/cry.gif\' class=\'bbc_emoticon\' alt=\':(\' />
[align=center]

“If you stop learning, you stop living.” ~Tami Quiring
“It's the rare man who understands the value of a single perfect rose.”
[/align]

“If you stop learning, you stop living.” ~Tami Quiring
“It's the rare man who understands the value of a single perfect rose.”
[/align]
Careful with Script Tags in Internet Explorer
yeah that\'s the only reason I\'m using it lol
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <-
poor class
[18:09:00] * ~Moppy stews ner0 erotically 1 times.
[18:09:00] * ~Moppy stews ner0 erotically 1 times.

