?
Solved

I have left doctype out for everything except IE on a homepage is that OK?

Posted on 2012-08-12
7
Medium Priority
?
429 Views
Last Modified: 2012-08-24
I have several javascript scripts running on a page and it seems that if I removed the doctype  for all browsers except IE, it all works fine. Otherwise I get a conflict.
From what I have read having no doc type should render them into "quirk mode".
Is this OK? It's just for this main page of the site , all else has a doctype.

Thanks in advance.
0
Comment
Question by:colonelblue
7 Comments
 
LVL 17

Expert Comment

by:selvol
ID: 38286627
<!doctype html>

Open in new window

If its html it should
SHould work fine.....


Brief Desc.
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 600 total points
ID: 38286672
I never heard of a way to only provide a DOCTYPE to only one browser.  I also never heard of a DOCTYPE having a direct effect on javascript.  Show us a link to the page.
0
 
LVL 6

Assisted Solution

by:GregArnott
GregArnott earned 300 total points
ID: 38286677
Triggering quirks mode shouldn't be an aim for your coding. You may not get errors being displayed, but you'll probably get elements just not working at all.

Setting up your page correctly should be the first step. I suggest HTML 5 boilerplate.

Second, run the page and discern the errors created from the scripts you are running.
IE and Chrome - hit F12.
FF - add Firebug add-on and hit F12.

As IE seems to be happy with the broken code, I strongly suggest you use one of the other browsers for determining the error. More than likely, the scripts you've added are using old IE only syntax.

You can also display the scripts and HTML here for debugging.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 600 total points
ID: 38288862
FF and Chrome do not use quirksmode.  That is an IE thing to try and get compatibility with the ancient crude in older version.  The good browsers default to "almost standards mode".

See:http://hsivonen.iki.fi/doctype/


If you need to remove doctype for the page to work then the page is seriously defective and needs to be fixed.  Removing the doctype is definitely not a valid approach.

Cd&
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 600 total points
ID: 38288908
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 600 total points
ID: 38289018
Hmmm...... interesting and even more so in that the Mozilla page actually has a link to the page I posted the link for.

I don't really worry much about mode, because I always use a modern doctype, but I probably should not be surprised that Mozilla can do quirksmode, as it is the most flexible and best browser around. :^)

Cd&
0
 

Author Closing Comment

by:colonelblue
ID: 38330707
I'm sorry I had not responded sooner. Thank you for pointing me the right way to look for a solution.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
When you put your credit card number into a website for an online transaction, surely you know to look for signs of a secure website such as the padlock icon in the web browser or the green address bar.  This is one way to protect yourself from oth…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question