O'Reilly Forums: Strange Behavior - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Strange Behavior

#1 User is offline   jnbutler1815 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 20-February 12

Posted 28 July 2012 - 02:58 PM

Okay, I have been away from this book for a couple of months and now I am getting back to working through the examples in chapter one again. I was going over the Guess the letter example and I know this was working before but now when I run it, I get just numbers when I press any letter and the message in the middle of the screen always says This is not a number. ?????? Did the browsers change support for the key pressed events while I wasn't looking? I am using the downloaded code to check mine and nothing is incorrect in the code and I have run this in Chrome, Firefox, Safari, and Opera all current versions.
I know this was working in Firefox back in April. What could be the problem?
0

#2 User is offline   jnbutler1815 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 20-February 12

Posted 25 November 2012 - 05:15 PM

View Postjnbutler1815, on 28 July 2012 - 02:58 PM, said:

Okay, I have been away from this book for a couple of months and now I am getting back to working through the examples in chapter one again. I was going over the Guess the letter example and I know this was working before but now when I run it, I get just numbers when I press any letter and the message in the middle of the screen always says This is not a number. ?????? Did the browsers change support for the key pressed events while I wasn't looking? I am using the downloaded code to check mine and nothing is incorrect in the code and I have run this in Chrome, Firefox, Safari, and Opera all current versions.
I know this was working in Firefox back in April. What could be the problem?



Doesn't someone know the answer to this question?
0

#3 User is offline   jnbutler1815 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 20-February 12

Posted 25 November 2012 - 05:50 PM

View Postjnbutler1815, on 25 November 2012 - 05:15 PM, said:

Doesn't someone know the answer to this question?



Okay, after much research I found that setting the event listener to keypress instead of keyup in the initGame() function, made the Guess The Letter app work for me. It shows the correct keys and only states Not a Letter when you press non letter keys.

It works in latest versions of Chrome, Safari, and Opera, however, it does not work in FF.

I have submitted an errata for this on the book page.

This post has been edited by jnbutler1815: 25 November 2012 - 05:51 PM

0

#4 User is offline   NickJohnson 

  • Active Member
  • PipPip
  • Group: Members
  • Posts: 15
  • Joined: 24-September 12
  • Gender:Male

Posted 07 December 2012 - 12:38 AM

You found out the solution for different browsers thats very impressive.
I hope you will find out for firefox as well.....
http://www.expertsfromindia.com/html5-designer.htm
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users