簡體   English   中英

如何使用html將Windows Phone(而非台式機Windows)重定向到移動網站?

[英]How do I redirect windows phones (but not desktop windows) to a mobile site using html?

我已經進行了一段時間的移動設備重定向,但是令我煩惱的是(據我所知)Windows Phone用戶沒有被重定向。

我的問題是,如何重定向Windows Phone用戶?

我的代碼:

 <script> if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { window.location = "http://m.ctworkshop.us/"; } </script> 

可能嗎? 如果要添加,我會加上什么名字?

PS。 在該列表中添加“ Windows”會重定向我不想執行的桌面Windows。

怎么樣

navigator.userAgent.match(/Windows Phone/i)

是Microsoft員工博客文章,內容涉及正確檢測使用相同策略的Windows Phone。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM