Results 1 to 5 of 5
  1. #1
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    2,191
    Thanks
    801
    Thanked 581 Times in 428 Posts

    Default HTML5 Qestion - Modernizr

    I just started reading a book HTML up and running by Mark Pilgrim. There is a script about modernizr, that you put in your header to detect what type of browser the person is using. Does anyone use this? Can anyone help me understand this in lamens terms? This is the script. Thank you


    <!DOCTYPE html>
    <html>
    <head>
    <meta charset=“utf-8”>
    <title>Dive Into HTML5</title>
    <script src=“modernizr.min.js”></script>
    </head>
    <body>

    Text in body

    </body>
    </html>

    <meta charset="“utf-8”">
    <title>Dive Into HTML5</title>
    <script src="“modernizr.min.js”"></script>

  2. #2
    slotplayer is offline Private Member
    Join Date
    September 2006
    Posts
    1,044
    Thanks
    198
    Thanked 322 Times in 252 Posts

    Default

    I always try and get newly published/edition books. I googled that book and its from 2010? Is that correct or do you have an updated edition?

    let me add the reason I say the date of the book matters is technology is always changing, back in 2010 what browsers were out there? IE8? IE9 was 2011 I think. Well almost nobody uses IE8 these days and I see many major sites dropping support for them.

    Its not browser detection but more feature detection. In other words does the browser version support the features of CSS3 and HTML5.
    Amazing how many sites think feature detection is something new, I was using it back when IE 4 came out.

    So here is a site that lists html5 features and browser versions that support them, make sure you check your browser and then other browsers. https://html5test.com/index.html

    here si another site that explains using mordernizr in detail.
    http://html5doctor.com/using-moderni...ide-fallbacks/
    Last edited by slotplayer; 27 February 2015 at 9:31 pm.

  3. #3
    edgarf76's Avatar
    edgarf76 is offline Private Member
    Join Date
    March 2013
    Location
    Montreal
    Posts
    2,191
    Thanks
    801
    Thanked 581 Times in 428 Posts

    Default

    Thank you! Yes that book was written in 2010 but I thought HTML5 was HTML5, I didn't think about the change in browsers.
    The reason I want to learn to code is to be able to write my owns scripts for thinks like geo targeting and other things for my site without using a wordpress plugin, which may slow the site down.


    Let's say I write a script for geo targeting, The moderizer is a tool to help me test every browser to see if the if the script is working (if I am using a VPS)? If Firefox releases a new update all webmasters have to check to see if their code is up to date with the latest edition and tweak it if it is not?

  4. #4
    slotplayer is offline Private Member
    Join Date
    September 2006
    Posts
    1,044
    Thanks
    198
    Thanked 322 Times in 252 Posts

    Default

    no, what modernizr does is two things: First it allow you to first check if a particular HTML5 and CSS Level 3 feature is supported by whatever browser/version the visitor is using and tells you in advance so your code can decide what to do if its supported or if not supported.

    The second thing it does is have what they call pollyfills which replicate the html5 feature in non-supporting browsers like IE8.

    So if you can see the Modernizr tutorial code segment below.

    test: Modernizr.geolocation simple asks does the visitors browser/version support the html5 feature geolocation?

    If yep run the geo.js script if nope run the geo-polyfill.js script.


    Modernizr.load({
    test: Modernizr.geolocation,
    yep : 'geo.js',
    nope: 'geo-polyfill.js'
    });


    So I know IE9 supports html5 Geolocation while IE8 doesn't. In either case Modernizr covers me.

  5. The Following User Says Thank You to slotplayer For This Useful Post:

    edgarf76 (28 February 2015)

  6. #5
    universal4's Avatar
    universal4 is offline Forum Administrator
    Join Date
    July 2003
    Location
    Courage is being scared to death...and saddling up anyway. John Wayne
    Posts
    32,086
    Thanks
    3,731
    Thanked 8,728 Times in 5,568 Posts

    Default

    So like a bb.....boo....a book....with words on paper pages and stuff???

    So you see all you youngins....they DO exist.....lol

    Ooops sorry, actually this could be a very interesting discussion since I have not yet had the time to look at all the changes in html 5.

    Scanning the page quick on the modernizer, it does appear to be a way to start developing for 5 and stay a backwards compatable....like ummmm....that other company has always tried to do that people claim lives in the past.....Microsoft.

    Rick
    Universal4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •