ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] ## .parseHTML() 字符串解析为 html ``` let str="<b>my name is</b>" let h = $.parseHTML(str) $("div").append(h) ``` ## .parseJSON() 字符串解析为 json ``` var obj = jQuery.parseJSON('{"name":"John"}'); alert( obj.name === "John" ); ``` ## .parseXML() 字符串解析为 xml ``` var xml = "<channel><title>RSS Title</title></channel>"; xmlDoc = $.parseXML(xml); $xml = $(xmlDoc); $title = $xml.find("title"); console.log($title.text()) // RSS Title ```