aspose file tools*
The moose likes Game Development and the fly likes The Grid - A Web game for Programmers and Strategists, but need Ajax help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Game Development
Bookmark "The Grid - A Web game for Programmers and Strategists, but need Ajax help" Watch "The Grid - A Web game for Programmers and Strategists, but need Ajax help" New topic
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: 61218
    
  66

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 61218
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The Grid - A Web game for Programmers and Strategists, but need Ajax help