| Author |
The Grid - A Web game for Programmers and Strategists, but need Ajax help
|
Gary Fisher
Greenhorn
Joined: Apr 16, 2011
Posts: 5
|
|
http://celtruler.com/games/thegrid/
It's a browser game that is going well but the Ajax requests sometimes don't complete, or rather they complete, but the text to be updated doesn't always update, mainly in Chrome. Any ideas? The game is in PHP now, but could be implemented in Java at some point. Thank you kindly in advance.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
|
Have you used the developer tools and the JavaScript console to find out what's different about the requests that don't work as expected?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Gary Fisher
Greenhorn
Joined: Apr 16, 2011
Posts: 5
|
|
|
Yes I have used the JS console, but there are no errors being thrown. In fact, what happens is that everything basically works, but every so often if I leave the web page for a while and then come back and press a button that triggers an AJAX request, nothing happens visually... The process goes through on the back-end, but on the front-end there is no manifestation until the page is refreshed. This only happens once in a while, and I'm wondering if that's a normal thing with AJAX, or is there truly some bad code that's to blame. Thank you.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
Nope, not "a normal thing".
In the cases where it's not working, have you checked the response to see if it contains what it should? Just looking for console errors is not enough.
|
 |
Gary Fisher
Greenhorn
Joined: Apr 16, 2011
Posts: 5
|
|
|
Thanks. I believe it may be because it's so Javascript intensive, that because there are several AJAX requests firing every second, and also some additional parsing going on (some of which could be done away with) after a minute or so the Javascript may get stuck and not execute. I believe I can probably fix it by cutting out the extra parsing, cutting down on the number of requests, and also by possibly putting more time between the requests.
|
 |
 |
|
|
subject: The Grid - A Web game for Programmers and Strategists, but need Ajax help
|
|
|