Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What doctype should I use for a mobile web application?

First of all, this is not a dupe of this question. You'll see why.

I'm working on a web application (not a mobile website; this will be JS-heavy), and the HTML we have so far (which was developed by someone else) uses the following doctype:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">

My question is: why not just use the standard HTML5 doctype?

<!DOCTYPE html>

What would be the differences between the two? The app we're developing is targeted towards smartphones (Android, iPhone, Windows Phone 7), but of course, we'd like to support as many platforms as possible (Symbian, BlackBerry, etc.).

What features / behaviors to the two doctypes enable / disable, and on what platforms?

What is the best doctype to use when developing a mobile web app? (and with this last question I will make this a community wiki)

Edit: How do I make this community wiki? :-/

like image 789
Felix Avatar asked Feb 26 '23 21:02

Felix


1 Answers

XHTML Mobile Profile long predates HTML5. It is aimed primarily at lower-powered mobile devices such as mobile phones from the pre-smartphone generation, as part of the “WAP 2.0” stack.

If you want to continue to support this kind of device you should continue to use XHTML Mobile Profile or XHTML Basic, and ensure that your documents are well-formed XML and use only the features from those specs. If you only care about the new generation of mobile user-agents, that happily render normal [X]HTML[5] pages designed from standard desktop browsers, you can drop it and use whatever doctype you like.

like image 90
bobince Avatar answered Feb 28 '23 18:02

bobince