test.html
//
<script language=javascript>
function f1()
{
for(i=0;i<3;i++)
{
 alert(i);
}
}
</script>

解决方案 »

  1.   

    我的意思是只用在a.htm里面加入相应的代码,来控制test.htm的文件,因为test.htm里面可能还有不同的恶意代码,而test.htm文件内容不变
      

  2.   

    或者说在a.htm有办法通过iframe或者其它方法取得iframe中src指向地址的内容
      

  3.   

    1:取src的内容
    2:改为<iframe src="empty.htm" width="540" height="405" border=0 scrolling=yes>
    3:将修改的内容写到empty.htm中去
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML XMLNS:IE; xmlns:MSHelp=http://msdn.microsoft.com/msHelp>
    <HEAD>
    <TITLE>DOWNLOAD Behavior Sample</TITLE><META NAME="AUTHOR" CONTENT="InetSDK">
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
    <META NAME="MS.LOCALE" CONTENT="EN-US">
    <META NAME="ROBOTS" CONTENT="noindex"><SCRIPT>
    //<!--
    function onDownloadDone(s) {
    oText.value=s;
    }
    //-->
    </SCRIPT>
    <!-- SAMPLE_STYLE_START -->
    <LINK REL="stylesheet" HREF="/workshop/basicSDKIE4.css" TYPE="text/css">
    <!-- SAMPLE_STYLE_END -->
    <LINK REL="stylesheet" TYPE="text/css" HREF="ms-help://Hx/HxRuntime/HxLink.css"><STYLE TYPE="text/css">
    PRE.clsCode { font-size:110%; } 
    PRE.clsSyntax { font-size:100%; }  
    TD DIV.clsBeta { display:none;}
      MSHelp\:link {
        color:#0000ff;
        text-decoration:underline;
        cursor:hand;
        hoverColor:#3366ff;
        filterString: ;}
    </STYLE>
    </HEAD>
    <!--TOOLBAR_START-->
    <!--TOOLBAR_EXEMPT-->
    <!--TOOLBAR_END--><BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#808080" ALINK="#000000">
    <BLOCKQUOTE CLASS="body"><!-- CONTENTS_START -->
    <H1>DOWNLOAD Behavior Sample</H1><P>This sample demonstrates how to download a file using the <b>download</b> behavior 
    introduced in Microsoft&#174; Internet Explorer 5.<IE:DOWNLOAD ID="oDownload" STYLE="behavior:url(#default#download)" /><P>Click <A HREF="javascript:oDownload.startDownload('test.htm', onDownloadDone)">here</A>
    to begin downloading this page and display the result in the following <B>TEXTAREA</b>.</P>
    <P>
    <TEXTAREA ID=oText COLS=65 ROWS=10 STYLE="background-color: #505050; color: #FFFFFF; font-size: 8pt; font-family: Arial; border: '2 outset';">
    </TEXTAREA>
    </P>
    <!-- CONTENTS_END --><!-- START_PAGE_FOOTER -->
    <BR><BR><BR>
    <MSHelp:link xmlns:MSHelp="http://msdn.microsoft.com/mshelp" keywords="msdn_copyright" TABINDEX="0">&copy; 2003 Microsoft Corporation. All rights reserved.</MSHelp:link>.
    <!-- END_PAGE_FOOTER -->
    </BLOCKQUOTE>
    </BODY>
    </HTML>
      

  4.   

    非常感谢,我想知道有支持firefox的吗?