Welcome to WebmasterWorld Guest from 54.167.29.212

Forum Moderators: open

Message Too Old, No Replies

DOCTYPE and Javascript?

Use of DOCTYPE blows up Javascript menu

     

D_Blackwell

6:04 pm on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This morning, while preparing to upload some files, I blew up the Javascript cascading menu on a home page.

After considerable back and forth, to and fro, -- merely by chance did I find the source, but I don't understand it.
----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

----
When I add the DOCTYPE the menu heads south. When I remove it, all is well?

What should I do? I've been making considerable effort lately to conform to standards, but this is a new one for me. I have to use this menu now, no matter what, but I do want to go back fix the issue, when I understand what it is.

drbrain

6:47 pm on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In IE6?

Your menu probably relies on the IE5.5 incorrect box model. The only way around this is to fix the javascript to conform to the CSS2 box model.

D_Blackwell

7:07 pm on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you. My conformance to higher standards has been going quite well, but occasionally I'm left clueless. The script will have to be used as is. I'm editing the CSS and the HTML.

The menu is a stop-gap to make the client happy until I can design a new permanent one. He wants a fancy drop-down menu right NOW. Not my priority, but not my money either.

Is there a preferable DOCTYPE that I should use for this one page in the meantime -- or just make no reference to to it at all for now?

tedster

7:35 pm on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You might try <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">, without including the URL. The browser should go back to quirks mode, and you've still got the reminder of what level of HTML you are writing.

If you "View Source" on this very page, you will see that approach being used.

D_Blackwell

8:06 pm on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'll do that. What is the liklihood of the menu rendering correctly in IE 5.5 this way? Or will it still break down? I don't have the means to see IE 5.5 for myself.

drbrain

9:03 pm on Jul 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IE5.5 doesn't do the 'doctype switch', so it should look fine.

g1smd

9:17 pm on Jul 3, 2003 (gmt 0)

D_Blackwell

3:00 am on Jul 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am so happy to have stumbled into Webmaster World. I'm trying to be judicious in my posting of questions, but the site has already been immeasurably valuable.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month