如何根据浏览器屏幕大小加载文件?这是我使用的代码:JS对于屏幕宽度
<script>
if(iPhone) { <- screen size instead of device
document.write("<meta name="viewport" content=\"width=480\""+"/>");
} else {
document.write("<meta name="viewport" content=\"width=1024\""+"/>");
}
</script>
感谢
你可以从这里开始https://developer.mozilla.org/en-US/docs/Web/API /窗口 – elclanrs