[英]how to insert javascript code that is disabled for mobile devices and only works on desktop?
[英]JavaScript disabled: how to show different messages for mobile and desktop.
禁用JavaScript时,我需要为台式机和移动网站显示不同的消息。
目前我有
<noscript>
<meta http-equiv="Refresh" content="0; URL=/error.html" />
</noscript>
而且我需要可以做到的代码(我使用伪代码)
<noscript>
if desktop
<meta http-equiv="Refresh" content="0; URL=/error.html" />
if mobile
<meta http-equiv="Refresh" content="0; URL=/mobile-error.html" />
</noscript>
谢谢
您的网站是否有服务器后端? 您可以尝试根据从连接浏览器接收到的用户代理进行移动浏览器检测。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.