Javascript 元视口标记在Windows phone IE浏览器中不起作用

Javascript 元视口标记在Windows phone IE浏览器中不起作用,javascript,jquery,html,responsive-design,windows-phone,Javascript,Jquery,Html,Responsive Design,Windows Phone,要检测我正在使用的用户代理,请使用下面的脚本。Windows phone似乎忽略了元视口标记。让其他人遇到同样的问题。基本上,我想缩小所有移动设备中的页面 if(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/Windows Phone/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i)

要检测我正在使用的用户代理,请使用下面的脚本。Windows phone似乎忽略了元视口标记。让其他人遇到同样的问题。基本上,我想缩小所有移动设备中的页面

if(navigator.userAgent.match(/Android/i)
  || navigator.userAgent.match(/Windows Phone/i)
  || navigator.userAgent.match(/webOS/i)
  || navigator.userAgent.match(/iPhone/i)
  || navigator.userAgent.match(/iPod/i)
  || navigator.userAgent.match(/BlackBerry/i)
  || navigator.userAgent.match(/iemobile/i)) {
    document.write('<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=0.25" />');

}

navigator.userAgent正在工作我通过警报检查了它,但viewport meta及其属性不工作。虽然我添加了初始比例=0.25,但没有显示缩小页面


除了Windows phone之外,所有移动设备中的一切都如预期一样。对于IE 10,您可以试试这个

if (navigator.userAgent.match(/IEMobile\/10\.0/)) {

初始比例仅在IE的纵向模式下有效检查

是否可以检查
navigator.userAgent
的值在您的问题案例中?navigator.userAgent正在工作我通过警报检查了它,但viewport meta及其属性不工作。我没有看到缩小页面,尽管我添加了初始比例=0.25好的,我不清楚(因为您的句子“也尝试了:
| | navigator.userAgent.match(/Windows Phone/I)
”IE的用户代理正在工作,但视口元标记不工作。我在userAgent下应用了警报,警报正在工作,但视口不工作。initial-scale.initial-scale仅在IE的纵向模式下工作
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {