DHTML Utopia by Stuart Langridge

DHTML Utopia by Stuart Langridge

Author:Stuart Langridge
Language: eng
Format: mobi, epub
Publisher: SitePoint Pty. Ltd.
Published: 2005-08-16T04:00:00+00:00


The Backspace key has a keyCode of 8. If Backspace has been pressed, and some letters have accumulated, we remove the last accumulated letter:

typeahead.js (excerpt)

if (code == 8) {

if (t.keyword != '')

t.keyword = t.keyword.substr(0, t.keyword.length - 1);

If a key other than Backspace was pressed, then we add the corresponding character to the accumulated string (as long as the key isn’t a control character; we don’t want to add a line feed if Enter is pressed).[35]

typeahead.js (excerpt)

} else if (code >= 32) {

t.keyword += character;

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.