iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • Perl with cheese...
    125,027

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Environmental Variables Available in Javascript using Navigator Object

    Environmental Variables Available in Javascript using Navigator Object



    Most environmental variables available in Perl and PHP are not accessible in Javascript.

    But there are still some very useful bits that might help you in your programming needs.

    You can access them via the navigator object like so:

    document.write(navigator.appName);

    Which prints:
    Netscape

    ... on my machine since I use Firefox on Mac.


    Or store their value in your own variable like this:


    var ji = navigator.appName;

    document.write(ji);

    Which prints:
    Microsoft Internet Explorer

    ... on my test machine over my shoulder that runs Windows XP.


    NOTES:
    - As always, the availability of the following environmental variables will depend on the user's Operating System and browser type. Example: cpuClass returns undefined if the user is on Firefox for Mac.
    - For more detailed info on this topic click here to search google for javascript navigator object (new window).



    Free Copy and Paste Javascript Code:

    <script type="text/javascript">
    <!--

    document.write("<br>appName is ");
    document.write(navigator.appName);
    document.write("<br>appCodeName is ");
    document.write(navigator.appCodeName);
    document.write("<br>appVersion is ");
    document.write(navigator.appVersion);
    document.write("<br>appMinorVersion is ");
    document.write(navigator.appMinorVersion);
    document.write("<br>userAgent is ");
    document.write(navigator.userAgent);
    document.write("<br>platform is ");
    document.write(navigator.platform);
    document.write("<br>cookieEnabled is ");
    document.write(navigator.cookieEnabled);
    document.write("<br>userLanguage is ");
    document.write(navigator.userLanguage);
    document.write("<br>systemLanguage is ");
    document.write(navigator.systemLanguage);
    document.write("<br>cpuClass is ");
    document.write(navigator.cpuClass);
    document.write("<br>onLine is ");
    document.write(navigator.onLine);
    document.write("<br>");
    document.write("<br>Method for testing Java Enabled (Use parenthesis):");
    document.write("<br>javaEnabled is ");
    document.write(navigator.javaEnabled());

    -->
    </script>


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: If, Else If, and Else in Javascript
    Next Article: Splitting an Array using Javascript





    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39

    CSSCSS

    David McFarland

    New $23.09

    Head First HTML with CSS...Head First HTML with CSS & XHTML

    Eric Freeman, Elis...

    New $23.99

    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    New Perspectives on HTML...New Perspectives on HTML and XHTML 5...

    Partrick Carey

    New $67.45

    HTMLHTML

    Gary B. Shelly, Th...

    New $84.55

    CSSCSS

    Eric Meyer

    New $29.69

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39


    Of Interest:
  • Combine, Put Two Arrays Together in Perl
  • Add to End of an Array with Push in Perl
  • Exit a Script or Subroutine in Perl
  • To Reverse an Array in Perl
  • Opening an Alert Box in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • Javascript Bold Text
  • Javascript SetTimeout
  • HTML Link
  • HTML Codes
  • Make a New Paragraph Using HTML
  • Make Italic Text Using HTML

  • More Articles:
  • Add to the Beginning of an Array with Unshift in Perl
  • Create or Put Items into an Array in Perl
  • Create a Subroutine in Perl
  • Matching at the Beginning and End 2
  • onClick Javascript
  • If, Else If, and Else in Javascript
  • Use onMouseOut in Javascript
  • Write a For Loop in Javascript
  • Get Query String Using Javascript
  • HTML Image
  • HTML Underline Text
  • HTML Background
  • HTML Codes

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    421,792
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:13 EDT