欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

javascript刪除html標(biāo)簽函數(shù)cIsHTML

 更新時(shí)間:2017年01月09日 21:38:19   投稿:mdxy-dxy  
這篇文章主要介紹了javascript刪除html標(biāo)簽函數(shù)cIsHTML,需要的朋友可以參考下

核心函數(shù)代碼:

function cIsHTML(str) {
		// parseHTML 會解析頁面中的代碼,故放棄此方法實(shí)現(xiàn)
		//try {
		// 	$.parseHTML(str);
		// } catch (e) {
		// 	return {
		// 		errno: e.name,
		// 		errmsg: e.message
		// 	};
		// }
		// return true;
		
		if (/\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i.test(str)) {
			return true;
		}

		return {
				errno: 'Invalid Html code',
				errmsg: 'Invalid Html code'
			};
	}

jQuery.parseHTML() 函數(shù)詳解的相關(guān)資料可以查看這篇文章:http://www.dbjr.com.cn/article/102498.htm

相關(guān)文章

最新評論