Site with JavaScript fails to render page in IE 6 or 7 but fine with FF

J

JJA

Previously, anything IE did not like threw some sort of error like
"object expected", etc. Now all I get is "Done" on the status bar...

I am suddenly having trouble with Internet Explorer. Both IE 7 and IE
6 behave the same way - they fail to render the page at all yet do not
seem to be detecting any errors on the client side. No errors occur on
the web server either.

I've issued VIEW SOURCE on this blank IE screen and captured it to a
text file. It looks "complete" to me and I am puzzled as to why it
won't render anything.

Yet everything renders fine with Firefox 1.5.0.11 !

I've issued VIEW SOURCE on the Firefox screen and captured it to a
text file with a different name. I've compared the IE text file with
the FF text file and they are identical.

I've replicated everything on our public web server so you experts
could have a look and offer comments or ideas.

Please browse the following and compare Firefox results to IE:

http://gis.cbmiweb.com/MDWmaps/

I am really stumped and hope someone can suggest something.
 
C

christoph.saxe

Hmmm - I took a very quick look and I wonder if it might be a simple
code problem.
I looked at it in IE's developer toolbar and when I checked the DOM,
the body tag had no children. that's why nothings displaying, while
the head is fine, and the title displays properly. I compared the
source, and the code for the body is there... so looking above the
body, trying to find something that might screw up IE's parser, I
found two candidates:

1) your <link> tag isn't formed properly. you have <link></>; it
should be <link /> for XHTML.

2) you have your inline script (browser detection) inside a comment,
but you haven't closed the comment. for some reason, FF as well as
Dreamweaver ignore this, however, the first following closed comment
is inside of the body tag (<!-- header -->) - I wonder if that's it.
 
J

JJA

Hmmm - I took a very quick look and I wonder if it might be a simple
code problem.
I looked at it in IE's developer toolbar and when I checked the DOM,
the body tag had no children. that's why nothings displaying, while
the head is fine, and the title displays properly. I compared the
source, and the code for the body is there... so looking above the
body, trying to find something that might screw up IE's parser, I
found two candidates:

1) your <link> tag isn't formed properly. you have <link></>; it
should be <link /> for XHTML.

2) you have your inline script (browser detection) inside a comment,
but you haven't closed the comment. for some reason, FF as well as
Dreamweaver ignore this, however, the first following closed comment
is inside of the body tag (<!-- header -->) - I wonder if that's it.

Yes that was it .... thanks for looking. I added the closing comment.
 
R

RobG

Yes that was it .... thanks for looking. I added the closing comment.

Wrong fix. HTML comment delimiters inside script elements are a
complete waste of time (as you've discovered), remove them entirely.
In an XML document, browsers have a right to ignore *anything* between
<!-- and -->, including script. But using XHTML on the web is
pointless, use HTML 4.01 strict.

<URL:
http://groups.google.com.au/group/c...ment+delimiters&rnum=1&hl=en#f4ee3e381d9b2755

The best way to include script in an XML file is to use an external
script file. If you really must include script, use CDATA delimiters:

<script type="text/javascript">
<![CDATA[
... unescaped script content ...
]]>
</script>

<URL: http://www.w3.org/TR/xhtml1/#h-4.8 >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top