admin管理员组文章数量:1389758
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
本文标签: javascriptNodejs Application Doesn39t Run in Safari or Internet ExplorerStack Overflow
版权声明:本文标题:javascript - Node.js Application Doesn't Run in Safari or Internet Explorer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744684025a2619586.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论