没错,就是这样一个需求;我现在有页面源文件的HTML字符串,
但是我需要去除里面的JS脚本,
当然也要同时去除标签中JS的调用哪位有实现的经验和思路可共享下,急急急!!!!~在线等...
但是我需要去除里面的JS脚本,
当然也要同时去除标签中JS的调用哪位有实现的经验和思路可共享下,急急急!!!!~在线等...
解决方案 »
- javascript:void(0) 和 javascript:void 0 的区别
- js刷新页面,并防止动作重复提交
- javascript基础
- 跪求帮忙 简单的js
- 急求FusionCharts3.2.1的FusionCharts.js文件和FusionChartsExportComponent.js
- 在Aptana这个软件里制作网页可以吗?需要注意什么吗?
- 显示日期的一段代码的疑问
- javascript中如何实现base64_encode??在线等,急啊
- 一个容易的问题,来捡分那~
- 如何在框架mainFrame文件main.asp中调用leftFrame文件left.asp中的javascript函数
- 求助牛人!javascript怎样实现检查当前站点是不是可信站点?
- 急 ,高级JS求助。 一个弱弱的问题。
我就是用的正则表达式去的JS脚本
关键就是调用那块儿 实在是头痛啊
不过还是谢谢 KK3K2005
下面的代码有问题吗?System.Text.RegularExpressions.Regex.Replace(htmlStr, @"<script[^>]*?>.*?</script>", "",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
$("#div_Preview_Content *").each(function () {
$(this).removeAttr("onblur");
$(this).removeAttr("onclick");
$(this).removeAttr("ondblclick");
$(this).removeAttr("onfocus");
$(this).removeAttr("onkeydown");
$(this).removeAttr("onkeypress");
$(this).removeAttr("onkeyup");
$(this).removeAttr("onmousedown");
$(this).removeAttr("onmouseout");
$(this).removeAttr("onmousemove");
$(this).removeAttr("onmouseover");
$(this).removeAttr("onmouseup");
});但是这样的实现方式,性能明显达不到要求谁能提供更好的实现或思路吗?