|
|
 |
BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0
 | This is the forum to discuss the Wrox book Professional JavaScript for Web Developers by Nicholas C. Zakas; ISBN: 9780764579080 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

January 16th, 2006, 09:49 PM
|
|
Registered User
|
|
Join Date: Jan 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
code in CH11 not work in FireFox
code: BlockPasteExample.htm;
BlockPasteExample1.htm;
BlockPasteExample2.htm
in IE, it work well, but in my FireFox(1.5), i cannot use the backspace.
it just block the backspace key.
is it a bug in FireFox? or in the code?
|

January 16th, 2006, 10:29 PM
|
|
Registered User
|
|
Join Date: Jan 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i change the code
Code:
if (bBlockPaste) {
return bIsValidChar && !(oEvent.ctrlKey && sChar == "v");
} else {
return bIsValidChar || oEvent.ctrlKey;
}
to
Code:
if (bBlockPaste) {
return (bIsValidChar|| oEvent.shiftKey|| oEvent.keyCode==8) && !(oEvent.ctrlKey && sChar == "v");
} else {
return bIsValidChar || oEvent.ctrlKey || oEvent.shiftKey || oEvent.keyCode==8;
}
then the FireFox works.
|

January 18th, 2006, 08:21 PM
|
 |
Wrox Author
|
|
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 206
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
It looks like Firefox 1.5 changed the way the keypress event works. In previous versions, it only fired when character keys were pressed (as in IE), but in 1.5 it looks like it also fires for non-character keys, which is why backspace isn't working. I'm going to have to investigate and see what the best solution is.
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |