PDA

View Full Version : File format for mobile html?



WebDizzy777
06-07-2013, 01:51 AM
I have done many regular websites, but am building my first mobile page using the IUI-js interface because it is pretty simple and easy to understand. A regular website would just be saved as index.html and then uploaded to my hosting service, however what file format would I save my mobile page up for uploading to my hosing service?

The computer knows to go to the homepage because it is saved as index.html.... but how would a mobile phone or tablet know to go to my mobile html and not my regular index? Hopefully this is a simple question to answer such as the correct file format.... Thanks.

P.S.

I know mobile websites are m.domain.com With the difference being the m. so does that have anything to do with it?

traq
06-07-2013, 03:26 AM
what file format would I save my mobile page up for uploading to my hosing service?
Plain text, just like any other webpage. .html for html files, .php for php files, and so forth.


The computer knows to go to the homepage because it is saved as index.html....
Not exactly: your server knows to give that page in response when a visitor asks for a directory with no filename.


but how would a mobile phone or tablet know to go to my mobile html and not my regular index?
It knows nothing like that. It never will. [I]You have to make that decision (or provide a way for the visitor to decide).


I know mobile websites are m.domain.com With the difference being the m. so does that have anything to do with it?
Using a subdomain for a mobile version of a site (e.g., m.example.com) is fairly common, but not necessarily what you want.

The idea is:
a) determine if the user is on a mobile device
b) send (redirect) them the the mobile version of the site

The disadvantages here (among others) are:
1) you don't always have a good way of determining a). The most common approach is to check the USER_AGENT request header - but this means you have to have an up-to-date list. There will always be edge cases where you have false results.

2) mobile users don't always want a mobile site. Phones can have screens with bigger resolutions than desktop computers these days. Personally, I hate mobile sites because they're almost always terrible to use.

3) most importantly, you have to maintain two different versions of your site. From now until forever.

You might consider responsive design (http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/) - redesign your site for small screens first, then start making changes for larger screens. Your javascript should use feature detection to decide what functions/events/etc. are available before trying to use it (do I have "click"? do I have "touch"? etc... moderizer (http://modernizer.com) is a good resource for this).