/    Sign up×
Community /Pin to ProfileBookmark

How reliable is html for portable access like on a PDA or mobile telephone?

I heard that some mobile devices support only xhtml/xml and can not properly handle html (if at all). Is this true? If so how widespread is this?

I’m building a site, but I want it to be available to mobile devices too. Ya think I should stick with just html 4.01 strict and hope mobiles accept it? Or do you think doing it in xhtml but sending it as an application of xml only to devices that accept it and sending as html to IE and older browsers would be best?

I’m pretty stumped here.

to post a comment
Full-stack Developer

7 Comments(s)

Copy linkTweet thisAlerts:
@MstrBobOct 29.2004 — The most accessible would be an XHTML website, and sending it as an application/xml type to supporting agents. You can use a bit o PHP for that. That would open you up to xml applications on the web, as well as standards browsers. I don't know if it's true that some mobile devices are only XML, but XHTML it won't harm it. Plus, it'll force you to validate your pages! ? I've used this bit of PHP I got from ryan brill:

[code=php]
<?PHP
# send application/xhtml+xml to conforming browsers
if (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
header("Content-type: application/xhtml+xml");
}
# and text/html to non-conforming browsers
else {
header("Content-type: text/html");
}
?>
[/code]
Copy linkTweet thisAlerts:
@Stephen_PhilbinauthorOct 29.2004 — [i]Originally posted by MstrBob [/i]

[B]Plus, it'll force you to validate your pages! ?[/B][/QUOTE]


:eek:

How dare you suggest I do not validate! You sir, are a scoundrel!

Have at you!

lol. Just kiddin'. Yeah I was thinking along those lines for making the site. Using that splash of php. Just not sure which side of the fence to come down on.
Copy linkTweet thisAlerts:
@Stephen_PhilbinauthorOct 29.2004 — What about this though:
<i>
</i>&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;


It still required? It seems pretty pointless given the <? xml ver declaration and the headder sent by the server.
Copy linkTweet thisAlerts:
@rhsundergroundOct 29.2004 — as you're developing for cell phones, check out opera's small screen renderer. in any opera 7 series just hit shift + f11 and you'll see the page similar to many cell phones.

http://www.opera.com/products/smartphone/smallscreen/
Copy linkTweet thisAlerts:
@Stephen_PhilbinauthorOct 30.2004 — Yeah I've used that for a long time now. Well.......... I used to. Can't get Opera to install on this thing, so I haven't used it in a while... >_<



Must...... get...... OPERA!!
Copy linkTweet thisAlerts:
@MstrBobOct 30.2004 — Are you suggesting that you are going to NOT use your content type/charset tag? *gasp* I use the same bit of code to write the proper thing.

[SIZE=1][code=php]
<?PHP
$xml_accept=false;
# send application/xhtml+xml to conforming browsers
if (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) {
header("Content-type: application/xhtml+xml");
$xml_accept=true;
}
# and text/html to non-conforming browsers
else {
header("Content-type: text/html");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr">
<head>
<?PHP
if($xml_accept===false)
{ echo('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."n"); }
elseif($xml_accept===true)
{ echo('<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />'."n"); }
?>
<meta name="Content-Style-Type" content="text/css" />
<meta http-equiv="content-script-type" content="text/javascript" />
<title></title>
</head>
<body>

</body>
</html>
[/code]
[/SIZE]

Also, in terms of javascript, you may have some issues. You have to use the XML DOM, for application/xhtml+xml, I believe.
Copy linkTweet thisAlerts:
@Stephen_PhilbinauthorOct 31.2004 — Yeah I keep my javascript to an absolute bare minimum. Preferably none. It's almost certain I'm going to be using at least some though. Hopefully nothing too low mind. Ability to concentrate now at an all time low.
×

Success!

Help @Stephen_Philbin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...