Cascading Style Sheets Tutorial

JavaScript tips of how to produce random

  Next we need to introduce you can generate a random function, but also to write JavaScript use of this function is that it tips.    Such skills in most of the compiler (compiler), so most of them are (or similar) to calculate the number of chaos.    JavaScript Finally, it should be also believe that a similar method to produce such a method, if it will provide this function, this function is the following results: 

  This is a calculated from the random .3861138662928667 

  Following is the practice of writing 

  <head> 
  <script Language="LiveScript"> 
  Function RandomNumber () ( 
  Today = new Date (); 
  Num = Math.abs (Math.sin (today.getTime ())); 
  Return num; 
  ) 
  </ Script> 
  </ Head> 
  <body> 
  <script Language="LiveScript"> 
  <! – 
  Document.write ( "This is a random number:" 
  RandomNumber ()); 
  / / -> 
  </ Script> 
  </ Body> 
  </ Html> 

  Our approach is more than an example of the function of time, it will be the emergence of a great number of further use of this operation can be.    For example: it used to do sine function (sin) operation, a few do have the absolute value of the operation, the results can be between 0 and 1 of a real, and because of the change is ms unit, and you must will not receive the same figures but this is not used for the continuous rapid series of randomly generated, but if you are not regularly use a long time, the effect on the good. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • DZone

Tags: css javascript

Releated Posts

  • Css + javascript drop-down menu
  • JavaScript build with the CSS + page tab
  • How to use Javascript dropdown menu with CSS Generation
  • CSS + javascript dialog box of colors
  • Css learning and web-javascript biographical notes on the production of a

This entry was posted on Tuesday, July 31st, 2007 at 12:00 am and is filed under CSS Tutorial. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« JAVASCRIPT DIV used to replace non-spacing to achieve the effect of rolling news
JavaScript object-oriented support (6) »

Leave a Reply

  • Categories

    • CSS Properties (491)
    • CSS Tutorial (1154)
    • CSS Tutorial By Examples (1201)
    • Css+Div Web Design (3274)
    • Xhtml and Web Design (1797)
  • Archives

    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
  • Pages

    • About us

Cascading Style Sheets Tutorial