A board game we made using Node.js, Javascript and jQuery works correctly on both Chrome and Firefox, but it doesn't seem to start the Javascript in Internet Explorer or Safari.
Here's a link to the uploaded version: /
I've tried it both from localhost and from the website, and I get the same results. Chrome and Firefox are fine. IE and Safari load the html and css, but large sections are blank (including the game board).
Is there something special we need to do to get it running on those browsers? I'm not even sure what area of the code to look at, and search results have not yielded anything directly related.
A board game we made using Node.js, Javascript and jQuery works correctly on both Chrome and Firefox, but it doesn't seem to start the Javascript in Internet Explorer or Safari.
Here's a link to the uploaded version: http://burningfreak./zb/freelance/wordwars/
I've tried it both from localhost and from the website, and I get the same results. Chrome and Firefox are fine. IE and Safari load the html and css, but large sections are blank (including the game board).
Is there something special we need to do to get it running on those browsers? I'm not even sure what area of the code to look at, and search results have not yielded anything directly related.
Share Improve this question asked Jul 28, 2014 at 3:14 Nightmare GamesNightmare Games 2,4356 gold badges36 silver badges47 bronze badges 1-
On Safari, I"m seeing the following error:
[Error] TypeError: 'undefined' is not a function (evaluating 'Number.parseInt(gameData[1])')
app.js line 1042 I don't see the error in Chrome. Perhaps, start there. – ryentzer Commented Jul 28, 2014 at 3:32
1 Answer
Reset to default 4To see the error causing the problem in Safari, you can use the Error Console. This is available in the "Develop" menubar menu that is by default hidden. Enable it through Safari -> Preferences -> Advanced, then check "Show Develop menu in menu bar". A new menu titled "Develop" appears in the menubar at the top of the screen. From there, choose "Show Error Console" and then load your page. You will see this error:
[Error] TypeError: 'undefined' is not a function (evaluating 'Number.parseInt(gameData[1])') (anonymous function) (app.js, line 1042) dispatch (jquery.min.js, line 3) handle (jquery.min.js, line 3) trigger (jquery.min.js, line 3) (anonymous function) (jquery.min.js, line 3) each (jquery.min.js, line 2) each (jquery.min.js, line 2) trigger (jquery.min.js, line 3) (anonymous function) (app.js, line 1018)
This boils down to the Number.parseInt() function, which, according to MDN ..
https://developer.mozilla/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt
.. is "experimental technology", and not supported on most browsers. Luckily, there is a "parseInt()" function without the "Number.", which is not experimental at all. Most likely removing the "Number." will at least move you forward nicely:
var playerNum = parseInt(gameData[1]);
Another issue you will notice is that the apps keeps polling on this non-existing URL:
http://burningfreak./socket.io/?EIO=2&transport=polling&t=1406517881111-30