iPhone/Android/黑莓上的jQuery

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/921130/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 02:30:57  来源:igfitidea点击:

jQuery on iPhone/Android/BlackBerry

jqueryiphoneandroidbrowserblackberry

提问by Brian Liang

I don't have any of the devices to test at the moment. I guess I'll start using the emulators later on.

我目前没有任何要测试的设备。我想我稍后会开始使用模拟器。

We're looking to offer mobile support. I was wondering how jQuery or even javascript renders in their respective browsers.

我们希望提供移动支持。我想知道 jQuery 甚至 javascript 如何在各自的浏览器中呈现。

What works? What doesn't? Any tips? Advice?

什么工作?什么没有?有小费吗?建议?

回答by Nosredna

I've used jQuery on iPhone. Remember that Mobile Safari is not an officially supported browser for jQuery. But it's close enough to Safari that most things work.

我在 iPhone 上使用过 jQuery。请记住,Mobile Safari 不是官方支持的 jQuery 浏览器。但它与 Safari 非常接近,大多数事情都可以正常工作。

If I recall correctly, mousedown event doesn't happen until the mouseup happens, at which point both fire. My guess is that most things will work, but you need to test everything carefully.

如果我没记错的话,mousedown 事件在 mouseup 发生之前不会发生,此时两者都会触发。我的猜测是大多数事情都会奏效,但您需要仔细测试一切。

My experience is that changing the DOM is unexpectedly slow. Things that fly on the emulator can drag on the device. (You mentioned you'd be using emulators--do NOT trust performance you get on them.)

我的经验是更改 DOM 出乎意料地缓慢。在模拟器上飞行的东西可以拖到设备上。(你提到你会使用模拟器——不要相信你在它们上获得的性能。)

jQuery might be overkill. I ended up relying on XUI, which gives you a lot of the jQuery stuff, but is much more lightweight, and also gives you touch events. http://github.com/brianleroux/xui/tree/master

jQuery 可能有点矫枉过正。我最终依赖于 XUI,它为您提供了很多 jQuery 的东西,但更轻量级,并且还为您提供了触摸事件。http://github.com/brianleroux/xui/tree/master



ppk has begun testing mobile browsers. http://www.quirksmode.org/m/w3c_core.html

ppk 已经开始测试移动浏览器。http://www.quirksmode.org/m/w3c_core.html

回答by Tom Merrihew

Came across this today and remember reading your post on here. Thought I would include the link for anyone that's interested in this jQuery project for the iPhone:

今天遇到了这个,记得在这里读过你的帖子。以为我会为任何对 iPhone 的 jQuery 项目感兴趣的人提供链接:

http://jqtouch.com/

http://jqtouch.com/

Haven't had a chance to try it out yet, but it seems to replicate a lot of the iPhone interface elements within the browser. I think it shows some promise, and uses a lot of the jQuery conventions.

还没有机会尝试,但它似乎在浏览器中复制了很多 iPhone 界面元素。我认为它显示了一些承诺,并使用了很多 jQuery 约定。

回答by AtariPete

Do not expect jquery to work much at all on Blackberry. The default browser is very limited in terms of JavaScript and page rendering.

不要指望 jquery 在 Blackberry 上运行得很好。默认浏览器在 JavaScript 和页面渲染方面非常有限。

Though opera on Blackberry might be a different story...

虽然黑莓上的歌剧可能是一个不同的故事......

回答by glennstar

I use JQTouch on i-phone a lot and think its great. It does not work on Android. JQuery is very, very slow (Android 2.0 HTC Desire and Legend) and as such JQTouch suffers. Also, animations are very poor, worse than WebKit nightly on my Mac, which are fairly flickery... You get the idea but nothing as smooth as the i-phone. I really like the Android platform and JQTouch, but they don't sit well together.

我在 i-phone 上经常使用 JQTouch 并认为它很棒。它不适用于 Android。JQuery 非常非常慢(Android 2.0 HTC Desire 和 Legend),因此 JQTouch 受到影响。此外,动画很差,比我的 Mac 上的 WebKit nightly 还差,相当闪烁……你明白了,但没有像 i-phone 那样流畅。我真的很喜欢 Android 平台和 JQTouch,但它们不能很好地结合在一起。

G*

G*

回答by Yoo

You can use this new lib: http://www.sencha.com/

您可以使用这个新库:http: //www.sencha.com/

回答by Jake Hall

The nice thing about JQTouch on andriod vs iPhone is w/ a little work you can swap the default themes.css so your site will look like an iPhone app on an iPhone, but a more generic mobile site on the android. Gives users of the phones what they expect with almost no work on your side.

Android 上的 JQTouch 与 iPhone 上的 JQTouch 的好处在于,您可以进行一些工作,您可以交换默认的 themes.css,这样您的网站在 iPhone 上看起来就像一个 iPhone 应用程序,但在 android 上则是一个更通用的移动网站。为手机用户提供他们所期望的东西,而您几乎不需要任何工作。

回答by Tim Inman

I'm using JQTouch for Android/iPhone. It looks great and functions. The loading screen and shortcut icons don't install like on iphone and the animations don't work, but it provides a great looking template.

我在 Android/iPhone 上使用 JQTouch。它看起来很棒而且功能齐全。加载屏幕和快捷方式图标不像在 iphone 上那样安装,动画也不起作用,但它提供了一个很好看的模板。