在线等。。。。。
改了utf-8也不行
以下是代码:
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>111111</title>
<style>
*{margin:0;padding:0;}
div{background:red;width:100px;height:100px;}
</style>
</head>
<body>





<div>afasdf</div>
</body>
<script src="jquery-2.1.4.min.js"></script>
<script>
window.onload=function(){
var aa="";
console.log($("body").length);
}
</script>
</html>
2 个解决方案
#1
var a=document.body.innerHTML;
document.body.innerHTML=a.replace(/\ufeff/g,'')
document.body.innerHTML=a.replace(/\ufeff/g,'')
#2
replace方法啊
#1
var a=document.body.innerHTML;
document.body.innerHTML=a.replace(/\ufeff/g,'')
document.body.innerHTML=a.replace(/\ufeff/g,'')
#2
replace方法啊