reset password
Author Message
savanes5
Posts: 8
Posted 19:11 May 31, 2014 |

I'm having an issuing getting my TicTacToe pages to send the async request. When I log in two players and visit the tic tac toe game page, it doesn't seem to send the request and wait for the response, but when each player visits its respective json url, it seems to work perfectly fine, sending a request, waiting for a match, then showing the JSON view of objects. What could cause this issue?

lbriggs
Posts: 57
Posted 22:37 May 31, 2014 |

Sounds like your controllers work, since you can get the json string when visiting the appropriate URL. Its sounds like you have a JavaScript error. The best way to debug that is using your browser's Dev tools. For Google chrome right click and select "inspect element" than click on the "console" tab to see any errors. In your JavaScript code you can use:

console.log("hello world"); 

to print messages to the browsers console.

Hope that helps.

savanes5
Posts: 8
Posted 22:47 May 31, 2014 |

Thank you so much. The problem was it was looking for jQuery in the wrong directory. My functioning relative URL was /user/ttt.html, so the browser was searching for /user/js file for jQuery. I was literally pulling my hair out trying to get this to work properly.

lbriggs
Posts: 57
Posted 23:42 May 31, 2014 |

Yeah the Dev tools in chrome has a resources tab where you can verify if all your assets have properly loaded to the browser.