1
votes

I have a 2 player cardgame app that I built using App Engine and the channel API. For the most part it works great, but I'm having a weird problem in Firefox.

When I enter a game in Firefox, I call socket.open, but nothing happens. I never get the onopen callback and don't receive any messages that I know should be on their way. The weird thing is that if I refresh the page, then the channel opens correctly! This only happens in Firefox, all other browsers work fine. Also, if I have Firebug open, then the channel opens correctly. So, it looks like it might be a timing issue. Some more relevant details:

  • The script tag that references the jsapi is not inside the head tag, it's inside the body.
  • I'm calling socket.open in jquery's $(document).ready callback.
  • I don't see any script errors in the error console. It just fails silently.

So, any ideas? If not for fixing, then does anyone at least know how I can get the logging info from the Channel API, I can see in the obfuscated source that it logs different things, but can't figure out how to get to the log messages.

1

1 Answers

1
votes

Two things to try out:

  • Move the jsapi reference to the HEAD section
  • Try using $(document).load callback instead

As you mentioned, this certainly sounds like some timing issue.