通过服务器端设备检测并行开发桌面和移动网络

发布于 2024-12-18 22:52:00 字数 510 浏览 4 评论 0原文

我正在开发一个网站,希望为用户提供移动和桌面友好的体验。

来自基础 html5/css/js 开发,我知道足够的 css 技巧、移动优先技术、液体布局和媒体查询,可以很好地相处,但可以进一步优化解决方案,并考虑到我目前开始使用 . net/mvc(包括剃刀)我正在寻找新的选择。

我读过有关设备检测技术的内容(目前倾向于 http://51 Degrees.codeplex.com/ ),现在我正在尝试找出为所有用户优化网站的选项。

我不希望移动用户加载大版本的图像和不必要的脚本/样式表/背景图像等,并且我不想像“移动优先”方法那样覆盖所有移动样式表。

由于我刚刚开始工作/学习如何使用 MVC 模式,我问你: 是否可以通过 MVC 模式/开发来构建一个组合网站(不是桌面版和移动版),并基于用户客户端/设备使用“if else”和一个选项来包含 javascript、图像 url、样式表等用户按需切换到完整版本。

I'm developing a website and want to provide a mobile and desktop friendly experience to the user.

Coming from base html5/css/js development, I know enough css tricks, mobile first techniques, liquid layouts and media queries to get along fine but to optimize the solution even more and taking into consideration that I'm currently starting to work with .net/mvc(incl. razor) I'm looking for new options.

I've read about device detection techniques (currently favoring http://51degrees.codeplex.com/ ) and now I'm trying to figure out the options I have to optimize my website for all users.

I don't want mobile users to load the large versions of images and unnecessary scripts/stylesheets/background images etc. and I don't want to overwrite all mobile stylesheets as in a "mobile first" approach.

As I have just started working / learning how to work with the MVC pattern I'm asking you:
Is it possible with the MVC pattern / development to build one combined website (not a desktop and a mobile version) and include javascript, image urls, stylesheets etc. based on the user client / device using "if else" and an option to let the user switch to the full version on demand.

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

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

发布评论

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

评论(1

追风人 2024-12-25 22:52:00

您可以为您的操作构建单独的移动视图,并在从移动设备调用站点时使用它们,或者使用从桌面调用的默认视图。

You could build seperate Mobile Views for your Actions and use them if the site is called from a mobile devide or use the Default View is called from a desktop.

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