Log in

View Full Version : How to make a web page PPC friendly?


Glisson
06-16-2003, 02:33 AM
Is there an app that will take a web page and size it for the PPC? I am wanting to create an offline site using a template ( because I'm no webdesigner ) and run it thru a magic program and have it come out perfect for my Axim. LOL. To much to ask?

Glisson

David Prahl
06-16-2003, 02:54 AM
As long as we're on the subject (or close to it), how does a website DETECT the browser of a PPC, and re-direct the visitor?

Sometimes I'll browse to a page on my PPC, and go to their mobile page automatically.

davidspalding
06-16-2003, 04:38 AM
Is there an app that will take a web page and size it for the PPC? I am wanting to create an offline site using a template ( because I'm no webdesigner ) and run it thru a magic program and have it come out perfect for my Axim. LOL. To much to ask?
Generally I look for the "print version" of a web page, and save that version to my PPC, or to Mobile Favorites in IE. Viewable in Pocket IE. Some sites -- like the NY Times -- even have their images cropped so that it doesn't overrun the PPC resolution.

If you're trying to create your own site from scratch, I think WAP and WebTV HTML standards also work for Pocket IE. Not sure where I read that.... YOu could find info on this at Webmonkey, certainly.

bargainPDA
06-16-2003, 06:03 AM
As long as we're on the subject (or close to it), how does a website DETECT the browser of a PPC, and re-direct the visitor?

Sometimes I'll browse to a page on my PPC, and go to their mobile page automatically.

Quite easy actually, your browser sends a whole host of headers to the server it's requesting a web page from, the server can look at the headers to see the browser type and do such things as (pseudo code):

browserType = Request.ServerVariables("HTTP_USER_AGENT")
if instr(browserType, "Pocket") > 0 then
'this is a Pocket PC Type browser
response.redirect "http://" & Request.ServerVariables("SERVER_NAME") & "/mobile/"
end if

rhmorrison
06-16-2003, 08:40 AM
browserType = Request.ServerVariables("HTTP_USER_AGENT")
if instr(browserType, "Pocket") > 0 then
'this is a Pocket PC Type browser
response.redirect "http://" & Request.ServerVariables("SERVER_NAME") & "/mobile/"
end if
I don't think this would work with my hp Jornada 568 because my HTTP_USER_AGENT string looks like follows:

Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320)

rhmorrison
06-16-2003, 09:13 AM
<HTML>
<BODY>
<SCRIPT LANGUAGE="JavaSCRIPT">
function msieversion()
{
var ua = window.navigator.userAgent
var msie = ua.indexOf ( "MSIE " )

if ( msie > 0 ) // If Internet Explorer, return version number
{
return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
}
else // If another browser, return 0
return 0
}
</SCRIPT>

<SCRIPT LANGUAGE="javascript">
document.write ( "HTTP_USER_AGENT = '" );
document.write ( window.navigator.userAgent );
document.write ( "'<br><br>" );

if ( msieversion() >= 7 )

document.write ( "This is Internet Explorer 7 or later" );

else if ( msieversion() >= 6 )

document.write ( "This is Internet Explorer 6" );

else if ( msieversion() >= 5 )

document.write ( "This is Internet Explorer 5" );

else if ( msieversion() >= 4 )

document.write ( "This is Internet Explorer 4" );

else if ( msieversion() >= 3 )

document.write ( "This is Internet Explorer 3" );

else

document.write ( "This is another browser" );

</SCRIPT>
</BODY>
</HTML>

rhmorrison
06-16-2003, 12:23 PM
You could ALSO take a look at this (http://webreference.com/tools/browser/javascript.html) URL.

Mike Temporale
06-16-2003, 01:17 PM
browserType = Request.ServerVariables("HTTP_USER_AGENT")
if instr(browserType, "Pocket") > 0 then
'this is a Pocket PC Type browser
response.redirect "http://" & Request.ServerVariables("SERVER_NAME") & "/mobile/"
end if
I don't think this would work with my hp Jornada 568 because my HTTP_USER_AGENT string looks like follows:

Mozilla/2.0 (compatible; MSIE 3.02; Windows CE; PPC; 240x320)

The code is only pseudo code, so it's more the concept that it's showing. It would work fine, except it's not looking for "Pocket", it should look for "PPC" or "Windows CE".

The code you posted only detects the browser type and not the OS version. So it won't acuratly redirect to a mobile version of the site. :wink:

However, both these solutions are good only if you expect PPC based devices to connect to your site. What about Phones? or Palms (good forbid). If you are looking at building a serious site, I would suggest getting familiar with Visual Studio .NET 2003. You can build your site as usual, and also build a mobile device version, where .NET will automatically detect the type of client connecting and render the page for that device. Very cool stuff. 8)