public static IValidation HasScriptLink(String jsSrc, String errorMessage = null)
{
return new ValidationDelegateTaken("JS 标签是否存在", ValidationType.Tag, (doc) =>
{
var htmlNode = doc.DocumentNode;
var nodes = htmlNode.SelectNodes(@"//script[@src]");
if (nodes == null)
{
return false;
}
return nodes.Where(n => jsSrc == n.GetAttributeValue("src", null)).Count() > 0;
}, errorMessage ?? string.Format("JS 标签 \"{0}\" 不存在。", jsSrc));
}