Welcome to WebmasterWorld Guest from 54.167.86.211

Forum Moderators: open

Message Too Old, No Replies

DOCTYPE and Javascript?

Use of DOCTYPE blows up Javascript menu

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts:1676
votes: 0


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.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 18, 2003
posts:827
votes: 0


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.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts:1676
votes: 0


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?

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

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


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.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts:1676
votes: 0


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.
9:03 pm on July 3, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 18, 2003
posts:827
votes: 0


IE5.5 doesn't do the 'doctype switch', so it should look fine.
9:17 pm on July 3, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts:1676
votes: 0


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.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members