function getCommentText(elemId){
var text = $("#"+elemId).contents().filter(function(){
return this.nodeType == 8;
}).get(0).nodeValue;
return text;
}
//使用
var jsonText = getCommentText(elemId);
转载于:https://my.oschina.net/oospace/blog/356558