1) CODE TITLE: Password Script
2) AUTHOR NAME/NOTES: Master_script_maker
3) DESCRIPTION: A password script that uses the Hotkey script here.
4) URL TO CODE: Here is the demo.
or, ATTACHED BELOW (see #3 in guidelines below):
1) CODE TITLE: Password Script
2) AUTHOR NAME/NOTES: Master_script_maker
3) DESCRIPTION: A password script that uses the Hotkey script here.
4) URL TO CODE: Here is the demo.
or, ATTACHED BELOW (see #3 in guidelines below):
Doesn't work in FF.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
I thought it would. Oh well.
Hmm... nicer to write it like:And yes, browsers tend to intercept various keys. It shouldn't be relied on anyway, though, so that's not really a problem; it's just a toy.Code:(function() { var realpass = "password", page = "example.html"; var w = "", r = new RegExp("[a-zA-Z0-9" + realpass + "]"); document.onkeypress = function(e) { var v = e || event, c = String.fromCharCode(v.charCode || v.which); if(r.test(c)) if(realpass === (w = w + String.fromCharCode(c))) location.href = page; else if(realpass.substr(0, w.length) !== w) w = ""; }; })();
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks