最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Can I reasonably assume mobile browsers with JavaScript also support jQuery? - Stack Overflow

programmeradmin4浏览0评论

I realise that this question may be almost impossible to answer definitively, but:

Is it reasonable to assume that mobile browser with JavaScript can also cope with jQuery? We're talking relatively basic jQuery such as click events and Ajax.

I'm writing a mobile HTML app. It involves slippy maps so anyone who wants to use it has to have JavaScript.

I'd much prefer to use jQuery for the rest of the coding if possible, but can I reasonably say to the client "any phone with JavaScript should support basic jQuery"?

I know about jQuery mobile, but I'm specifically talking about phones that aren't advanced enough to handle jQuery mobile, but do have JavaScript.

Thanks!

I realise that this question may be almost impossible to answer definitively, but:

Is it reasonable to assume that mobile browser with JavaScript can also cope with jQuery? We're talking relatively basic jQuery such as click events and Ajax.

I'm writing a mobile HTML app. It involves slippy maps so anyone who wants to use it has to have JavaScript.

I'd much prefer to use jQuery for the rest of the coding if possible, but can I reasonably say to the client "any phone with JavaScript should support basic jQuery"?

I know about jQuery mobile, but I'm specifically talking about phones that aren't advanced enough to handle jQuery mobile, but do have JavaScript.

Thanks!

Share Improve this question asked Apr 21, 2011 at 19:23 simonsimon 6,11713 gold badges33 silver badges28 bronze badges
Add a ment  | 

8 Answers 8

Reset to default 5

Yes.

jQuery is not a language. It is a library written in JavaScript, and therefore if you can run JavaScript reasonably well, you should be able to run jQuery without any problems.

With that being said, nothing pares to actual testing. Periodically check that your code works across multiple platforms (not only on different phones, but different web browsers as well).

javascript is javascript. You can always use jQuery.support to detect features. You should test on the browsers you want to support anyway.

The answer is simple: yes.

JQuery, and especially its most basic features, is designed to be cross browser. If the mobile browser has reasonable javascript support, JQuery should not be an issue.

For fallbacks on features you aren't sure whether or not are supported, you can use jquery.Support or Modernizr

It should run okay on most... don't expect much from explorer pocket.

Although jQuery functions across these browsers, IRL many of the cool effects that jQuery makes simple won't be seen on a mobile browser, because the interface is so different. There is (almost) no concept of mousedown, mouseup, or hover; click and focus behave differently, screensize is different vs effective window size, animations are slow, etc. The challenge in mobile browsers is mostly in the interface design. The main advantage IMO is AJAX-loaded content, for speed and low data/bandwidth usage.

In short: yes.

HOWEVER, if you're only doing Ajax and other little things, you'll see a significant speed gain just using vanilla JS. But I do realize this can be somewhat of a pain. There are lighter-weight packages out there, like xui.

Honestly, I'd consider programming separate sites for mobile Safari (iOS and Android), and other lower-powered devices that don't run WebKit.

To iterate again: jQuery.mobile is NOT a replacement for jQuery, but rather framework that builds on jQuery, much like jQuery-ui does. This would be an even larger footprint and bootstrap time.

You can check http://jquerymobile./ - maybe it is what you should use on your pages instead of "regular" jquery.

Yes but you will better off using jQuery Mobile in case you are developing for mobile devices. It's optimized for them.

Check out jQuery mobile, as well as this very informative slideshare which describes the scope and difficulty of the problem you're facing.

发布评论

评论列表(0)

  1. 暂无评论