Many mobile browsers these days are based on
the WebKit engine (http://webkit.org/) and you can test on that too. But do
remember that testing on real devices may have varying results.
Chapter 10
[ 193 ]
On the other side, what if your target users don't have AJAX support? It's always a
good practice to have a backup! Though AJAX support is increasing, do take some
time to build a fallback for your production applications. The dev.mobi article
mentioned earlier shows a good example of how you can do this.
While doing AJAX, don't go overboard. Animated "loading" images,
animations, and other eye candy may actually hinder the usability of your
application because of the download size and CPU needs. Stay focused on
the user!
Adding Navigation
We got one recipe on the page. But we need a simple way to navigate within the
recipes. This is very easy now with our GetRecipe function. What we need to keep
track of is the current index of the recipe. And we can add one or subtract one from it
to get the next or previous recipe. Let's code it up!
Time for Action: Adding Navigation for Recipes
1. If you noticed, in the previous code, we have checked if the requested index
is greater than zero.
Pages:
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259