Mobile Safari 和 Mac 上的 Safari 之间的 JavaScript 差异?

发布于 2024-09-08 20:36:33 字数 421 浏览 1 评论 0原文

嘿,这个问题很笼统,但我想知道 Mobile Safari 和 Mac 版 Safari 中的 Javascript 差异是什么。

我的印象是,从 Javascript 的角度来看,它们是相同的,只有 CSS/渲染方面存在一些差异。但我在 Mobile Safari 中遇到了一些在 Mac 上的常规 Safari 中不存在的 Javascript 错误。

基本上,对某些 jQuery 插件的许多调用都会返回未定义的值(根据 Mobile Safari 中的开发人员调试器)。

我遇到这些问题的网站有一个非常糟糕的前端,充满了验证错误、糟糕的 JS,并且附加了大量的 CSS。我毫不怀疑这个问题就在这段代码中的某个地方,而且我以前从未遇到过这样的问题。

我只是在解决这个问题时遇到了麻烦,因此任何关于 Javascript 引擎的一般差异的见解/链接将不胜感激。

Hey this question is pretty general, but I'm wondering what the Javascript differences are in Mobile Safari and Safari for Mac.

I was under the impression that from a Javascript perspective they are the same, with only some differences in CSS/rendering. But I am experiencing a number of Javascript errors in Mobile Safari that don't exist in regular Safari on Mac.

Basically a number of calls to certain jQuery plugins are returning undefined values (according to the developer debugger in Mobile Safari).

The website that I'm experiencing these issues on has a very lousy front end that is riddled with validation errors, lousy JS and has an enormous amount of CSS attached. I have no doubt that this issue lies somewhere in this code, and I've never experienced issues like this before.

I'm just having trouble honing in on the problem, so any insight/links as to the general differences in Javascript engines would be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦初启 2024-09-15 20:36:33

Javascript 本身作为核心语言,也不例外。 DOM 中存在一些未记录的显着差异,但大多数情况都是相同的。在这里您可以看到 您可以处理的事件

我注意到的 DOM 差异与测量元素有关。例如,getClientRects(至少对于 Selection 或 Range)不可用。可能还有其他事情。

Javascript itself, the core language, is no different. There are a few significant differences in the DOM that appear undocumented, but mostly it is all the same. Here you can see some differences in events that you can handle.

The DOM differences I noticed had to do with measuring elements. For example getClientRects, at least for a Selection or Range, was not available. There are probably other things.

朦胧时间 2024-09-15 20:36:33

在我补充两点关于 Safari 因环境或构建而异的差异之前:Safari 可能的环境列表不仅仅是 iPod、iPhone、iMac。

我还正在处理:Windows(桌面)的 Safari 和 iMac 上iOS 模拟器中的移动 Safari。

我的 jQueryMobile + PhoneGap 应用程序在 Windows 版 Safari(桌面版)和 iMac 上的 Safari 中运行良好,但在带有 XCode 3.x 的 iMac Snow Leopard 上的 iOS 模拟器上的 Safari 中存在以下问题:

  1. Google Analytics 在 iOS 中收到“白名单拒绝”模拟器。
  2. 我的应用程序由于另一个问题而在用户设置过程的早期挂起

其他问题可能是以下任何一个:

  1. 放置在元素之后的标签可能无法加载
    对 localDb 的正确
  2. 调用可能不会通过
  3. jQuery 的事件(pageinit、click 等)进行,但可能不会以相同的方式进行

Before I add my two cents about differences in Safari depending on environment or build: the list of possible environments for Safari is bigger than just iPod, iPhone, iMac.

I am also dealing with: Safari for Windows (desktop) and Mobile Safari in iOS Simulator on iMac.

My jQueryMobile + PhoneGap app works nicely in Safari for Windows (desktop) and Safari on iMac, but it has the following problems in Safari on iOS Simulator on iMac Snow Leopard with XCode 3.x:

  1. Google Analytics gets a "whitelist rejection" in iOS simulator.
  2. My app hangs early on in the user's setup process through another problem

That other problem could be any of:

  1. tags placed after element may not be loading
    properly
  2. calls to localDb may not be coming through
  3. jQuery's events (pageinit,click,etc) may not come though in the same way
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文