iPhone App Con Sept 27 -- www.iphonedevcon.com
Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 16th, 2006, 09:49 PM
din din is offline
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old January 16th, 2006, 10:29 PM
din din is offline
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old January 18th, 2006, 08:21 PM
nzakas's Avatar
Wrox Author
Points: 714, Level: 10
Points: 714, Level: 10 Points: 714, Level: 10 Points: 714, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 206
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ch11 msxml3 code prob humayunlalzad BOOK: Beginning XML 3rd Edition 1 May 19th, 2007 02:38 AM
ch11 "Using XML and Ajax" example doesn't work nick_rasband@byu.net BOOK: Beginning Ruby on Rails 2 March 27th, 2007 06:13 PM
CMS doesn't appear to work with Firefox 1.5 abel714 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 September 18th, 2006 10:45 AM
Why does this work in Firefox but not in IE???? Ov1 Javascript 2 August 11th, 2006 05:47 AM
Errata,Code,Ch11,ListboxAddExample.htm din BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 1 January 17th, 2006 09:28 AM



All times are GMT -4. The time now is 03:51 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 2010 Wiley Publishing, Inc