Qustion about 'web browser' identification (mobile)

Discussion in 'Programming' started by standard240, Sep 30, 2007.

  1. #1
    Hi,
    I was wondering if anyone could tell me how exactly a website knows if you are visiting from your computer (ie/firefox) or from your cell phone browser???

    For example, if I go to http://mobile.google.com in firefox, it is a different webpage than if I use my mobile browser.

    I just need to know how it works, or how I can access the mobile version of a webpage on my PC?

    Any info will help!
     
    standard240, Sep 30, 2007 IP
  2. litebulb1

    litebulb1 Peon

    Messages:
    151
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you can program that all in CSS. I dont think you will be able to access the mobile version from a computer.
     
    litebulb1, Sep 30, 2007 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Of cause you can, people building sites for mobiles dont have to get their mobile out each time they want to check how it looks.

    http://support.microsoft.com/kb/320977

    Above has links for windows internet explorer mobile to view on your PC - you can certainly also get emulators for WAP and other mobile options.

    As to how they do it? There are a number of options, .Net has built in mobile components that will identify the users system capabilities and modify the page appropriately for them.
     
    AstarothSolutions, Oct 1, 2007 IP
  4. theOtherOne

    theOtherOne Well-Known Member

    Messages:
    112
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #4
    On every request browsers send a parameter called User Agent. Therefore a server / script can recognise the browser you are using (e.g. a mobile phone is not likely to send "Firefox" as its User Agent) and is able to deliver adjusted content.

    If only the design is to be changed, this can be set while linking a website to its stylesheets.
    Short example for using different stylesheets according to the purpose of display:
    <link rel="stylesheet" media="screen,projection,tv" href="main.css" type="text/css">
    <link rel="stylesheet" media="print" href="print.css" type="text/css">
    <link rel="stylesheet" media="handheld" href="smallscreen.css" type="text/css">
    HTML:
    Or, for a full description: http://www.howtocreate.co.uk/tutorials/css/mediatypes
     
    theOtherOne, Oct 1, 2007 IP