ASP.NET MVC 不显眼的 Ajax 在移动 Safari 中仍然很显眼

发布于 2024-11-29 08:55:28 字数 194 浏览 4 评论 0原文

如果我在 ASP.NET MVC 3 应用程序中使用 Ajax.ActionLink,当我使用移动 Safari 浏览网站并单击我的 ajax 链接时,浏览器地址栏会下拉并短暂显示 POST url。没什么大不了的,但它会让人分心,而且大多数支持 Ajax 的网站似乎都没有这个问题。我能做些什么来避免这种情况发生,并且仍然能够使用 Ajax 助手

If I use Ajax.ActionLink in my ASP.NET MVC 3 app, when I browse the site with mobile Safari and click my ajax links, the browser address bar drops down and briefly shows the POST url. Not a huge deal, but it is distracting and most Ajax-enabled sites don't seem to have this issue. Is there anything I can do to make that not happen, and still be able to use the Ajax helpers

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

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

发布评论

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

评论(1

不打扰别人 2024-12-06 08:55:28

不引人注目的 javascript 的主要原则之一是为用户提供在打开或未打开 javascript 的情况下工作的可能性。如果您的 JavaScript 打开 - 您单击链接并获取弹出窗口/更新。但除此之外,您还可以将此链接用作简单链接 - 打开新页面。

Ajax Helpers 工作正常,因为它渲染具有超引用和数据属性的跨浏览器 html 标签,这应该受到支持。

ASP.NET MVC 脚本(“jquery.unobtrusive-ajax.js”)中没有问题,因为它们的算法仅基于 JQuery 并且假设 JQuery 支持所有浏览器。

JQuery 确实做到了这一点,但根本没有,特别是对于旧浏览器(jquery 浏览器支持)和一些浏览器功能被削减(出于性能原因或再次老化)的移动平台可以正常工作(jquery 移动平台支持) 。

我希望它对你有帮助。

One of main principle of unobtrusive javascript is give possibility to work users with and without javascript turned on. If your javascript turned on - you click link and get popup/update. But else you work with this link as simple link - open new page.

Ajax Helpers works normally, because it render cross-browser html tag a with hyperreference and data attributes, that should be supported.

And there is no problems in ASP.NET MVC Scripts ("jquery.unobtrusive-ajax.js"), because their algorythms based on JQuery only and on assumption, that JQuery supports all browsers.

And JQuery really do that, but not at all, especially not for old browsers (jquery browser support) and some mobile platforms with cutted (for performance reasons or again old age) capabilities for browser works normally (jquery mobile platforms support).

I hope it help you.

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