View Full Version : Need DOCTYPE workaround

02-23-2009, 08:02 AM
1) Script Title: ddaccordion.js

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm

3) Describe problem: I am using menu a site for which i have no control over the DOCTYPE . It is a Monster Commerce shopping site and the control the doctype. Unfortunately they left out the 2nd http part, making it invalid and making my menu flicker. You can check it out on my demo site.

First with doctype as assigned by Monster (flickers in IE) =

and with valid DOCTYPE (no flicker)=

So my question. Is there anyway around this since i cannot change the DOCTYPE itself?

02-23-2009, 05:43 PM
That's not why it's broken: http://validator.w3.org/check?uri=http%3a%2f%2fwww.crinv.com%2faccordionTest.html

02-23-2009, 06:24 PM
That's not why it's broken: http://validator.w3.org/check?uri=http%3a%2f%2fwww.crinv.com%2faccordionTest.html

Sure about that Twey? The working document has the same (I imagine error corrected by the browser) errors. I think this flickering is only an issue in one or more versions of IE when it is thrown into quirks mode.

02-23-2009, 07:01 PM
I know it has many problems, on the validation front, but for the moment i really only care if it works in IE, which it does just fine when i replace the doctype as i did on http://www.crinv.com/accordionTestGood.html (everything else same) . I think i will still get flicker even with errors fixed unless i can change the doctype (by some back way) , or force IE into standards compliance mode some other way. Am i wrong there?

I will revise it and try to get it to validate...unless you think it is a waste of time due to the doctype issue?


02-23-2009, 07:31 PM
I don't think it's possible to work around it, no. Writing valid HTML might cause it to consider it valid, but really you should be complaining to the IE developers. That's a perfectly valid DOCTYPE, but IE doesn't seem to recognise it as one.

02-23-2009, 07:59 PM
Yah, Its an IE problem really, i realize now. (unfortunately i don't think they'll listen to me) .

Anyway here is pages that validated.

with Monster assigned DOCTYPE =

and with IE recognized DOCTYPE=

Same deal Flickers on 1st not on 2nd. I seem to be stuck between IE and Monster.

Is there no trick to make it work?
Somehow use javascript to insert a line before the DOCTYPE or something, or if could just add the http part to end of DOCTYPE ?
Use doument.write to create new page with new doctype and old page contents? hmm...

02-23-2009, 08:00 PM
I don't think so, no. By the time it gets to your code, IE has already seen the DOCTYPE and decided in what mode it's going to parse the page.

02-24-2009, 12:48 AM
I don't think so, no. By the time it gets to your code, IE has already seen the DOCTYPE and decided in what mode it's going to parse the page.

Geez, I come up with the reason, you get all the thanks. Couldn't happen to a nicer person (you) though.

I tend to agree, how can you change the DOCTYPE after it's parsed? Javascript seems inadequate to the task. The only thing I can think of, and I tend to doubt that this exists, but since there is a meta tag:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">

to get IE 8 to act like IE 7, perhaps there is/are other IE specific meta tags, in fact there are (the one that disables the galleryimg (<META HTTP-EQUIV="imagetoolbar" CONTENT="no">) functionality for all images on a page, others that enable enter page and leave page transitions), but I mean one that might help in this case . . .

However, a cursory Googling of the subject tends to indicate none for this purpose. But the MS knowledge base might have an answer (be it with meta data or otherwise), it's just rather tedious to sift through, and not always very clear about the exact circumstances and/or contraindications of a given implementation.