解析HTML字符串内容,第一个参数为html内容,第二个参数为是否自动修复html
xiyueta().parse()属性方法,两种调用方式:
1、xiyueta().parse("<ul><li></li><li></li></ul>"); //解析HTML字符串
2、xiyueta().parse("<ul><li></li><li></li></ul>",false); //解析HTML字符串,不自动修复html
总结:xiyueta().parse()解析类似于cheerio库的.load(),在xiyueta.js库里也可以用$.load()解析html
尝试一下>>
<script src="https://www.xiyueta.com/js/xiyueta.min.js"></script> <script>
var html='aa<ul>bb<li>cc</li>dd</ul>ee'; $.log( $().parse(html) );
</script>
length: 0
selector:
domList:
x: undefined
y: undefined
domListArray
domListIndex: 0