[英]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.