如何通过java脚本或任何逻辑检查任何网址是移动网站还是简单(常规)网站? [英] how to check that any url is mobile web site or simple(regular) web site via java script or any logic?

查看:117
本文介绍了如何通过java脚本或任何逻辑检查任何网址是移动网站还是简单(常规)网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生/妈妈,

如何通过java脚本检查任何网址是移动网站还是简单(常规)网站还是给我任何逻辑?



谢谢

dear sir/mam,
how to check that any url is mobile web site or simple(regular) web site via java script or give me any logic?

thanks

推荐答案

你不能,至少不是所有网站都没有,这样做没有一致的标准,即使所有网站都不太可能遵守它。我们的英国站点使用http:// hostname / mobile,但外国版本使用相同的URL来实现相同的功能。





最好的办法是通过常见的场景,开发一个灵活的基础架构,允许您在出现时添加新的基础架构。如果您可以控制要跟踪的站点,则可以添加元数据,指定它是移动站点,并从 jQuery [ ^ ]或JavaScript
You can''t, at least not for all sites, there is no consistent standard for doing this, even if there were it is unlikely all sites would adhere to it. Our UK site uses http://hostname/mobile, but the foreign versions use the same URLs for the same functionality.


Your best bet is to work through common scenarios and develop a flexible infrastructure that allows you to add new ones as they arise. If you have control of the sites you are going to track, you could add metadata specifying it is a mobile site and get that from jQuery[^] or JavaScript


这篇关于如何通过java脚本或任何逻辑检查任何网址是移动网站还是简单(常规)网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆