读书人

怎么过滤iframe里面的script和图片

发布时间: 2012-02-16 21:30:36 作者: rapoo

如何过滤iframe里面的script和图片

我想调用别人的一个页面,试图用 iframe的方法来引用对方的页面。

对方的页面地址:http://weblive.hichannel.hinet.net/hiliveModule/player.jsp?cid=39

但对方的页面有判断,如下:

<SCRIPT language= "JavaScript ">
try{
var loc = parent.document.location + ' ';
//document.writeln( 'Location : ' + loc);
if ( loc.indexOf( 'http://weblive.hichannel.hinet.net ') != -1)
;//document.writeln( "ok " + loc.indexOf( 'http://weblive.hichannel.hinet.net '));
else
{
//document.writeln( "no " + loc.indexOf( 'http://weblive.hichannel.hinet.net '));
parent.window.document.location = 'http://weblive.hichannel.hinet.net/ ';
}
}
catch(e)
{
//alert(e.message );
//document.location = 'http://weblive.hichannel.hinet.net ';
window.open( 'http://weblive.hichannel.hinet.net ', '_top ');
}

</script>

谢谢。

[解决办法]
通过XMLHttp获取那一页的生成的HTML代码,过滤之后显示

读书人网 >ASP

热点推荐