See "About This JavaScript Site" in JavaScript Index and Introduction.
ISBN-13 has been introduced to supersede ISBN-10; no new ISBN-10 should be issued after 2006. For a description of ISBN-13, see at isbn-international; thanks to Paul Harper of NM Library for finding that document.
The final character of each Number is a check digit, calculated from the seven, nine or twelve descriptive digits of the Main Part. ISSN and ISBN-10 use corresponding digit-weighting algorithms; that for ISBN-13 differs.
ISBN-10 converts to ISBN-13 by prepending an EAN UCC (generally 978) and recalculating the check digit.
For each form, there are functions below to verify a full ISSN or ISBN and to calculate the check digit (as a one-character string) from the main part. Input to those is free-format, but for ISNCodeTest the check digit must be the final character.
In the following code, 9999 is merely a sufficiently large multiple of 11.
Written on the assumption that ISSN-8 is like ISBN-10, which fits test ISSNs.
For showing the EAN bar code corresponding to an ISBN-13 number, see Bar Code.
Bar codes can be drawn by positioning black and white divisions.
Beware the effects of various forms of Zoom in various browsers.
This at least approaches accordance with Wikipedia Universal Product Code (UPC) and European Article Number (EAN-13), including ISBN-13. For validating ISBN numbers, see also ISBN-13.
The bar code structure is created either by composing an HTML string or by using DOM methods. It could also be done by using a table for the layout and using DOM methods to add the values.
Any actual user must test and adjust the code for complete conformity with the actual standards.
In UPC, a leading zero is (often?) printed but not encoded.
In EAN, it is encoded by bar-parity. Non-digits are ignored. Samples :-
• UPC : 0 000168 461651;
• EAN : 3 474370 505828,
5 000205 035765, 5 000354 401947, 5 032307 065425,
8 936017 883171, 8 710624 290092, 8 722700 267966.
• ISBN-13 : 9 780540 087013, 9 781565 925212.
Tests are needed for each of the other first digits, comparing
against printed codes.
2009-05-30,31 | MS IE 7 | Firefox | Opera | Safari | Chrome | |
---|---|---|---|---|---|---|
HTML | Just below | Bad 1 | Good | Good | Bad 4 | Good |
HTML | This page | OK 2 | Good | Good | Good | Good |
HTML | New page | Good | Good | Good | Good | Good |
DOM | Just below | Good | Good | Good | Good | Good |
DOM | This page | Good | Good | Good | Good | Good |
DOM | New page | Bad 3 | Good | Good | Good | Good |
|
The result should slightly resemble that in GIF, which shows an old version.
The principle is to write coloured divs of calculated size and position them absolutely to build the chart. The Mean (red) and Zero (blue) lines are div-border-bottoms, location questionable.
Alternatively, images of colour could be positioned.
Consider also the canvas element (except in IE≤8), used in Plot Web Site Statistics.
This should show the enumerable properties of an Object and their present values.
For dates :-
Possibly the best function so far; for all numbers ≥ 0 :-
John Wallis :-
See Wikipedia and discussion.
There may occasionally be a wish to alter the operation of a function without changing its source code; for example, if it is in a frequently updated external library. One reason might be to alter colours; another, to provide translated strings.
This is the initial test, slightly improved; FuncA1 has no arguments.
Following test, improved more; function FA2 can have arguments.
This tests apparent instances of YYYY-MM-DD DoW in texts. It checks that Y-M-D is valid AD Gregorian and that DoW agrees. The year may be any number of digits, but if past about 275000 the date and DoW will not be verified. Paste the input into the textarea. See the code for details. Please do not use this page repeatedly; make a local copy.
Buttons 1 - Site check : pre-process at DOS prompt
with (mtr is MiniTrue-32)
mtr -x+ -o *.htm - "<li><tt>(\d.*)</tt>.*"
= \1\r > $X
or
mtr -x+ -o -c- *.htm - \d\d\d\d-\d\d-\d\d\s*[A-Z][a-z]{2}\W > $X
or
findstr /r [0-9]-[0-9][0-9]-[0-9][0-9] *.htm > $X
or
findstr /rn /c:"[0-9]-[0-9][0-9]-[0-9][0-9]
[a-z][a-z][a-z]\>" *.htm > $X
or otherwise (maybe SED?). Checks the first date on each line
(lines without dates are removed), and shows errors at end of line.
Button 1a shows all lines, 1b omits good ones.
Button 2 - Checks an HTML page, or anything else. Each error is reported in a confirm box, with some leading context.
In the command box, the field separator is TAB; if it is not possible to type it in, then paste or drag it.
Note that RegExps are used, and compose the commands accordingly.
Not yet working correctly.
Enter KOI8-R coded text in the first box, and press the button. The first output is a transliteration to Cyrillic, using a table which is moderately checked. The second output is based on the approximate match between the sounds of KOI8-R and offset ASCII characters. Characters not forming part of a sequence "= Hex Hex" are preserved.
KOI8-R letters occupy C0-FF (in two cases), and are transliterated. The range 00-7F is as ASCII, and so treated. Characters in the range 80-BF are mostly graphics, and are represented as ╬.
This should automatically list, in alphabetical order, all different links (ignoring anchors) on this page.