O'Reilly logo

Beginning Facebook Game Apps Development by Wayne Graham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recording Puzzle Information

Now that we have created a table to record our information, we need to work on saving data from the puzzle to it. Because we want this to feel like an application, we can take care of the posting of scores to the server with AJAX. Since we already have jQuery included for this project, this is a really simple refactor. As with any AJAX code, there are two pieces: the server-side code that processes the request and the client side that initiates it. I will start with the JavaScript to build the AJAX request and send it to the server and then implement the server side response.

Passing data in AJAX can be quite simple. For our purposes, I am creating a new object in the javascripts/puzzle.js file to hold the data the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required