JavaScript at Davar Web Site

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vladimir Veytsel

    #1

    JavaScript at Davar Web Site

    Please find at the link below samples of JavaScript programming
    techniques along with several useful fully-functional JavaScripts.



    JavaScript Frequently Asked Questions
    JavaScript programming code patters
    Extract navigation bar generation (function)
    Local control of modification date colors (driven by date difference)
    Random song (random selection from a list sectioned into 3 parts)
    Random problem (random selection from a list sectioned into "n" parts)
    Random tagline (random selection controlled by selection history)
    Alphabet hyperlinks generation (function)
    Go board position generation (function)
    Productivity issues of the document.write
    JavaScript links

    --
    Best regards,
    Vladimir Veytsel.

  • HikksNotAtHome

    #2
    Re: JavaScript at Davar Web Site

    In article <3F2DC27E.F2772 280@optonline.n et>, Vladimir Veytsel
    <Davar@optonlin e.net> writes:
    [color=blue]
    >http://www.davar.net/INTERNET/JAVA-SCR/JAVA-SCR.HTM
    >
    >JavaScript Frequently Asked Questions[/color]

    Why is this:

    Math.floor(Math .random()*(N-M+1))%(N-M+1)+M

    Better than whats in the c.l.j FAQ?


    function Random(x) { return Math.floor(x*Ma th.random()) }
    --
    Randy
    All code posted is dependent upon the viewing browser
    supporting the methods called, and Javascript being enabled.

    Comment

    • Lasse Reichstein Nielsen

      #3
      Re: JavaScript at Davar Web Site

      hikksnotathome@ aol.com (HikksNotAtHome ) writes:
      [color=blue]
      > Why is this:
      >
      > Math.floor(Math .random()*(N-M+1))%(N-M+1)+M
      >
      > Better than whats in the c.l.j FAQ?
      >
      > http://www.jibbering.com/faq/#FAQ4_22
      > function Random(x) { return Math.floor(x*Ma th.random()) }[/color]

      Normally it isn't, but in some older browsers, the Math.random
      function could return 1.0. The extra modulo operation takes care of
      that. The only browsers I know of with that problem is Opera 4 and 5
      (and according to Dr. J.R. Stockton, Opera 6.01 had the same problem,
      but 6.05 doesn't: <URL:http://www.merlyn.demo n.co.uk/js-randm.htm#MR>)

      /L
      --
      Lasse Reichstein Nielsen - lrn@hotpop.com
      Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      Working...