开发者

Search on a Mobile Web Page

开发者 https://www.devze.com 2023-04-11 08:58 出处:网络
I\'m in the process of building a mobile page (using jquery mobile) which requires a search feature. I\'m debating wheather to use an auto-complete. Trouble is it would need to hit something server si

I'm in the process of building a mobile page (using jquery mobile) which requires a search feature. I'm debating wheather to use an auto-complete. Trouble is it would need to hit something server side. It's not really possible to have the search results client side as there's too many and would make for a large download. Do you think the search shou开发者_JS百科ld submit back to the server or use ajax style autocomplete?

I've never made anything like this so bear with me.


All depends on the Mobile Devices / OS'es you are targeting. High-end devices like the ones running iOS, Android and WP7 can easily run JS. And people who got those normally have data plan so you can go for Ajax calls for auto-complete (remember that each call is a request, so uses uer's internet connection).

If you target for mid/low-end ones, go for normal form actions. Do NOT rely on JS on these kind of devices, since most of them have buggy implementations of JS and most of them comes with 'Enable JavaScript' turned off by default (die Blackberries, die!)

If you are trying to be wide and support all, as meagar said, try both. Ajax with a fallback for normal form actions.

But remember that mid/low have smaller screens and most of them are not touch devices, so remember to try make the ajax answer not be with fixed width height or floated/absolute display since user might not be able to scroll.


Ideally it should do both, using AJAX to fetch results and dynamically update the page, falling back to standard browser requests when JavaScript isn't available.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号