当定义视口元标记时,Android 浏览器在 Ajax 调用时崩溃

发布于 2024-08-28 12:16:07 字数 282 浏览 6 评论 0原文

我正在构建一个网络应用程序,旨在在 Android 浏览器上运行。

当我的网页包含任何类型的视口元标记时,如下所示:

<meta name="viewport" content="width=400"/>

我的网页在 ajax 调用时崩溃。当使用模拟器、我的 Nexus 上的实际浏览器和 droid(均运行 Android 2.1)时会发生这种情况。

如果没有元标记,ajax 调用将按其应有的方式运行。

有什么想法吗?

I am building a web app, which is intended to run on the Android browser.

When I have a webpage that contains any kind of viewport meta tag, like this:

<meta name="viewport" content="width=400"/>

My webpage crashes on ajax calls. It happens when using the emulator, the actual browser on my nexus one, and on a droid (all running Android 2.1).

Without the meta tag, the ajax calls run as they should.

Any ideas?

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

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

发布评论

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

评论(2

深爱不及久伴 2024-09-04 12:16:07

您可以尝试使用下面的元标记。

我已经成功地使用了这些元标记,并且 AJAX 调用在 Nexus One 上确实对我有用。

<meta name="HandheldFriendly" content="true" />

You may try using the below meta tag.

I have successfully used both these meta tags and AJAX calls did work for me on the Nexus One.

<meta name="HandheldFriendly" content="true" />
把回忆走一遍 2024-09-04 12:16:07

另外,现在建议您设置 content="width=device-width" 并使用 CSS 设置页面样式,使其看起来至少可以接受。否则你会在 iPad 上看到放大得离奇的页面。

当然,如果您已经有办法处理这个问题,也没关系。

Also, it's recommended these days that you set content="width=device-width" and style the page with CSS to look at least tolerable. Otherwise you get a ridiculously zoomed-in page on the iPad.

Of course, never mind if you already have a way of dealing with that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文