Home arrow Web Design Blog
Web Design Blog

Detect user's device and redirect to a mobile web PDF Print E-mail

While working on mobile web, first is think about how to detect the user's device. If the user is using a mobile device, then you have to redirect to a mobile web, not a general long and 3 or 4 columns website.

In Apache web server, Browser ID, more correctly called User Agent IDs, is the environmental variable HTTP_USER_AGENT. In dot net server (ASPX), you can use a string variable Request.UserAgent.

Here is a great place you can find a whole list of the Mobile Browser ID strings, a.k.a. User Agent ID: http://www.zytrax.com/tech/web/mobile_ids.html

JavaScript code use navigator.userAgent

 
<button onclick="alert(navigator.userAgent);">User Agent</button>
 

Background color testing PDF Print E-mail

This is a simple JavaScript example to fade out a background color using function and array...

Click to fade out   Green

 
function fade(id) {
    var dom = document.getElementById(id),
        level = 1;
    function step () {
        var h = level.toString(16);
        dom.style.backgroundColor = '#FF'+h + h + h + h;
        if (level < 15) {
            level += 1;
            setTimeout(step, 100);
        }
    }
    setTimeout(step, 100);
}
function green(id){
   var dom = document.getElementById(id);
   dom.style.backgroundColor = '#009966';
}
 

The JavaScript Programming Language PDF Print E-mail

Learning the Basics - from: http://developer.yahoo.com/yui/theater/

The awesome people at Yahoo uploaded their training session videos to the world in general. Great deal for us, since learning JavaScript is as easy as spending four hours watching these smart guys talk.

Douglas Crockford: "The JavaScript Programming Language" 1 of 4


Read more...
 
<< Start < Prev 1 2 3 4 Next > End >>

Results 19 - 21 of 21
Banner

USATODAY.com Video - Talking Tech