function cIsHTML(str) {// parseHTML 会解析页面中的代码,故放弃此方法实现//try {// $.parseHTML(str);// } catch (e) {// return {// errno: e.name,// errmsg: e.message// };// }// return true;if (/s?<!doctype html>|(<html[^>]*>|<body[^>]*>|<x-[^>]+>)+/i.test(str)) {return true;}return {errno: "Invalid Html code",errmsg: "Invalid Html code"};}jQuery.parseHTML() 函数详解的相关资料可以查看这篇文章:http://www.jb51.net/article/102498.htm