JavaScript Text, String, and Number Articles
You are here: irt.org | Articles | JavaScript | Text, String, and Number
Synopsis: Written by Janus Boye. Math is power. So says one of the many ads on the Internet. JavaScript has the power, to do all functions that are on a normal pocket calculator, and even a few more.
Techniques: Math, random(), round(), NaN, isNaN(), sin(), cos(), tan(), acos(), asin(), atan(), E, LN10, LN2, LOG10E, LOG2E, PI, SQRT1_2, SQRT2, abc(0), atan2(), ceil(), exp(), floor(), log(), max(), min(), pow(), sqrt()
Synopsis: This article describes how to select random numbers from a range, to produce a selection of lottery numbers. As an added bonus it shows how to also randomly show a background color.
Techniques: Random numbers, empty arrays, images, table background color
Synopsis: Describes how to split nested strings
Techniques: split, length, array, replace, while, break, string, substring, indexOf, function overridding, JavaScript1.1
Synopsis: Describes how to split strings, and how to split strings in JavaScript 1.0. Also describes how the two methods can be combined to provide a script suitable for all browsers.
Techniques: split, length, array, while, break, string, substring, indexOf, function overridding, JavaScript1.1
Synopsis: Describes methods associated with the String object, how to use them to find characters or strings within strings, to replace characters and portions of text, to change the case and to alter the style and formatting of text.
Techniques: length, charAt, indexOf, lastIndexOf, split, substring, replace, iteration, toLowerCase, toUpperCase, upperFirst, upperInitial, arguments, big, blink, bold, italics, small, strike, sub, sup, fixed, fontsize, fontcolor
Synopsis: Describes how to show images and text at random, how to show one of several forms randomly, refer to random banner adverts, random urls, random background color and images, how to generate a random questionnaire, and random frames.
Techniques: Math.random(), rnd(), rand(), seconds, getSeconds, %, modulus, images, forms, arrays, windows
Synopsis: Covers scrolling text within a text box
Techniques: form, text, onSubmit, onClick, scrolling, setTimeout, substring, timer, buttons
©2018 Martin Webb