If you face any problem, add an alert(responseText); after the first line in
the ProcessXHR function in frost.js. That will show you the HTML code
coming from the server. You may also use the dbg()function for any other
debugging needs. If your mobile device does not support JavaScript, the
following figure is what you may see.
What's Going on in the Background?
We created a platform for building AJAX-enabled applications. The way it works
is that when the page gets loaded in the browser, the JavaScript will execute and
check if the browser has XMLHttpRequest (XHR) object support. If it does, we call
the GetRecipes function with 0 as argument. That in turn calls the ShowDetails
function of Frost library. This put up a loading image in the main div and makes
an XHR request through the XHReq function. This is an asynchronous call, and the
ProcessXHR function will be called once the server's response is received.
On the server, the PHP code makes a query, and limits it for one record starting from
0. Once we get the recipe data, we format it using some nice HTML. We also use a
custom function to split the data at new line characters and show it in a list format.
Pages:
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257