获取屏蔽符号屏蔽的字符串的代码

function getCommentText(elemId){
 var text = $("#"+elemId).contents().filter(function(){
        return this.nodeType == 8;
    }).get(0).nodeValue;
 return text;
} 

//使用
var jsonText = getCommentText(elemId);

你可能感兴趣的:(jquery)