Book Image

MooTools 1.2 Beginner's Guide

Book Image

MooTools 1.2 Beginner's Guide

Overview of this book

MooTools is a simple-to-use JavaScript library, ideal for people with basic JavaScript skills who want to elevate their web applications to a superior level. If you're a newcomer to MooTools looking to build dynamic, rich, and user-interactive web site applications this beginner's guide with its easy-to-follow step-by-step instructions is all you need to rapidly get to grips with MooTools.
Table of Contents (14 chapters)
MooTools 1.2 Beginner's Guide
Credits
About the Authors
About the Reviewer
Preface

Time for action—determining the client's rendering engine and version


We're going to check what rendering engine you're using. If you have several browsers installed in your work station, try the same script in all of them:

  1. For the markup, you can use the following:

    <body>
    <div id="browser-info">
    <p>The rendering engine you're using is: </p>
    <p>The rendering engine's version is: </p>
    </div>
    </body>
    
  2. Open your HTML document in a browser to preview your work. You should see the following figure (it shouldn't have the rendering engine information yet):

  3. We'll get information about the browser engine name and version using Browser.Engine.name and Browser.Engine.version, and then assign them to the variables browserEngine and browserEngineVersion. If for some reason we can't determine the values, we assign them values "Unknown" by using || (which means "or"). To do this write:

    var browserEngine = Browser.Engine.name || "Unknown";
    var browserEngineVersion...