$.parseJSON() 把JSON格式的字符串转换成JSON
JSON.pase <====> eval
JSON.stringify() 把json对象转换成字符串
<script>
var xml="<rss version='2.0'><channel><title>RSS Title</title></channel></rss>";
xmlDoc=$.parseXML(xml),
$xml=$( xmlDoc );
$title=$xml.find("title");
$( "#someElement" ).append( $title.text() );
$title.text( "XML Title" );
$( "#anotherElement" ).append( $title.text() );
</script>
function Aaa(){
this.defaults={
show:$.noop
//show:function(){}
};
}
Aaa.prototype.init=function(opt){
$.extend( this.defaults,opt )
}
script=document.createElement("script");
script.text=code;
document.head.appendChild(script).parentNode.removeChild(script);
js 解析xml demo
最新推荐文章于 2020-12-12 12:13:11 发布