how to get window width in javascript how to get window width in js How to Detect Screen Resolution with JavaScript window https://developer.mozilla.org/en-US/docs/Web/API/window/innerWidth https://www.w3schools.com/jsref/prop_win_innerheight.asp fun…
昨天在帮同事调试JS的时候,FF报错了,$(window).width() is not a function.我以前也是这么用的,都没问题,为什么现在就报错了呢? 这是因为jQuery用"$"操作符代替"document.getElementByIdx_x"操作,很有可能是它们冲突了. 解决方案是将你代码中的"$"替换成"jQuery","jQuery"的大小写要完全一致,要不然也会报错…