We are using a form and a hidden variable that stores the recipeId in the output.
This will be used later in the JavaScript function that submits a comment on a recipe.
Once this is done, we check the recipeComments table for comments made on this
recipeId. If we find any, we include them also in the output.
All this output from PHP comes in ProcessXHR as responseText. And we put that
in the main div. As we do this, the page content changes and shows us our recipe!
And all this happened without reloading the page!
Mobile AJAX
[ 192 ]
What if Your Device Does Not Support AJAX?
If the devices you are testing on do not support AJAX, it would be difficult to test.
One option is to use a service like DeviceAnywhere (www.deviceanywhere.com)
that allows you to remotely test on a variety of mobile devices and carriers. You get
to test on the actual devices remotely, and it's very convenient to test multiple real
devices from a single place. The following screenshot shows our POTR application
running in an iPhone over DeviceAnywhere.
If you do not want to use DeviceAnywhere, you can test with desktop versions
of Opera and Safari browsers.
Pages:
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258