homepage Welcome to WebmasterWorld Guest from 174.129.130.202
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
DOCTYPE and Javascript?
Use of DOCTYPE blows up Javascript menu
D_Blackwell




msg:1485443
 6:04 pm on Jul 3, 2003 (gmt 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.

 

drbrain




msg:1485444
 6:47 pm on Jul 3, 2003 (gmt 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.

D_Blackwell




msg:1485445
 7:07 pm on Jul 3, 2003 (gmt 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?

tedster




msg:1485446
 7:35 pm on Jul 3, 2003 (gmt 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.

D_Blackwell




msg:1485447
 8:06 pm on Jul 3, 2003 (gmt 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.

drbrain




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

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

g1smd




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

[webmasterworld.com...]
[webmasterworld.com...]

D_Blackwell




msg:1485450
 3:00 am on Jul 4, 2003 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved