日期:2014-05-17  浏览次数:20905 次

如何过滤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代码,过滤之后显示