禁用JavaScript:如何为手机和桌面显示不同的消息。

禁用JavaScript:如何为手机和桌面显示不同的消息。,javascript,noscript,Javascript,Noscript,当禁用JavaScript时,我需要为桌面和移动网站显示不同的消息 目前我有 <noscript> <meta http-equiv="Refresh" content="0; URL=/error.html" /> </noscript> 我需要这样的代码(我使用伪代码) 如果桌面 如果是移动的 谢谢您的网站有服务器后端吗?您可以尝试根据从连接浏览器接收的用户代理进行移动浏览器检测 请参见是否可以相应地设计error.html,使其在所

当禁用JavaScript时,我需要为桌面和移动网站显示不同的消息

目前我有

<noscript>  
    <meta http-equiv="Refresh" content="0; URL=/error.html" />
</noscript>

我需要这样的代码(我使用伪代码)


如果桌面
如果是移动的

谢谢

您的网站有服务器后端吗?您可以尝试根据从连接浏览器接收的用户代理进行移动浏览器检测


请参见

是否可以相应地设计
error.html
,使其在所有设备上看起来都很好?否,它需要显示不同的内容
<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>