Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: Munchor on August 15, 2011, 04:15:44 pm

Title: Mobile Javascript and HTML Design, Other Questions
Post by: Munchor on August 15, 2011, 04:15:44 pm
Does any of you know any guide on how to design programs that run well on mobile browsers? Thanks.

I'd also like to know how this kind of URL's work:

http://www.omgubuntu.co.uk/about/ (http://www.omgubuntu.co.uk/about/)

The page has to have a file name, like about.php or about.html, so how do they hide the file name?

I thought that maybe they use Javascript to change the URL in the window, is that how they do it?

Thanks.
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: Michael_Lee on August 15, 2011, 04:20:28 pm
Programs or webpages?
Either way, I'd be interested to know also.

It's probably a server-side thing -- you can configure servers so that file extensions are stripped off, or something.

(You can also place a 'index.html' file inside of a folder with the name you want, and typing in the url of that folder will redirect to the index file, but it doesn't feel like the prettiest solution to me.)

Edit: Hmm -- I have 888 posts...  Now, if only I had 88 respect...
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: Deep Toaster on August 15, 2011, 05:09:33 pm
Edit: Hmm -- I have 888 posts...  Now, if only I had 88 respect...
I can help with that >:D
Does any of you know any guide on how to design programs that run well on mobile browsers? Thanks.
http://www.webpagefx.com/design-build-mobile-web-site.html
I'd also like to know how this kind of URL's work:

http://www.omgubuntu.co.uk/about/ (http://www.omgubuntu.co.uk/about/)

The page has to have a file name, like about.php or about.html, so how do they hide the file name?

I thought that maybe they use Javascript to change the URL in the window, is that how they do it?
Just name the file one of index.php, index.html, or index.htm and it'll show up as the default page for that directory.
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: jnesselr on August 15, 2011, 05:17:32 pm
You can also modify what page you want to use, IIRC.
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: Anima on August 15, 2011, 05:46:07 pm
I thought that maybe they use Javascript to change the URL in the window, is that how they do it?
No, i think they modify this with a .htaccess file.
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: Deep Toaster on August 15, 2011, 06:16:01 pm
By default index.php, index.html, index.htm, default.php, default.html, and default.htm should be recognized as index. (If you're hosted on Juju's server, all of these work. No need to modify .htaccess.)
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: flyingfisch on August 30, 2011, 02:39:21 pm
Use javascript or php to automatically choose the css for the screen size.

OR

Use a liquid layout.

OR

Make another page with a javascript redirect that redirects if sceen size is smaller than x.
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: Ikkerens on September 20, 2011, 05:42:46 am
No, i think they modify this with a .htaccess file.

This is correct, Apache web servers have a mod named MOD_REWRITE ( http://httpd.apache.org/docs/2.0/misc/rewriteguide.html )
This allows urls such as http://www.example.com/page (without page being a folder)
or even: http://www.example.com/id/15/page/home/, which is then converted by apache to
Code: (php) [Select]
<?php

$_GET 
= Array(
"id" => 15,
"page" => "home"
);

?>


And as far as I know apache is the only server supporting this.
Unless you also count self-written servers in.
For example, I have written my own webserver for use in a game I'm currently developing, which uses:
http://localhost/JavaScript and http://localhost/CSS

<script src="JavaScript" type="text/javascript"></script> ftw
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: Deep Toaster on September 20, 2011, 09:33:40 am
ephan was asking about displaying a page as a folder, and you can do that by naming it index.html, without modifying .htaccess. You can use .htaccess, of course, but remember every line you add slows down every request to your site a bit.
Title: Re: Mobile Javascript and HTML Design, Other Questions
Post by: Ikkerens on September 20, 2011, 10:27:17 am
ephan was asking about displaying a page as a folder, and you can do that by naming it index.html, without modifying .htaccess. You can use .htaccess, of course, but remember every line you add slows down every request to your site a bit.
By making a folder containing index.html/php/htm you can, yeah, but it's ugly.
And .htaccess doesn't slow down the site that much. (1ms on an average webhost, max)
Because .htaccess is cached by apache.