use frames['iEditor'].sContent, for example1.editor.htm:
<script language="javascript">
sContent= 999;//this makes sContent part of window
</script>
<input id="txt1" value="123">
2. frame.htm:
<IFRAME src="editor.htm" name=iEditor width="100%" height="190">
</IFRAME>
<input type="button" value="get iframe variable" onclick="alert(frames['iEditor'].sContent)">
<input type="button" value="get iframe value" onclick="alert(frames['iEditor'].document.all('txt1').value)">

解决方案 »

  1.   

    index.htm<IFRAME src="editor.asp" name=iEditor width="100%" height="190">
    </IFRAME>
    <INPUT type="button" value="显示text控件值" id=button1 name=button1 onclick="alert(iEditor.document.all.txt.value)">
    <br>
    <INPUT type="button" value="显示变量值" id=button2 name=button2 onclick="alert(iEditor.name)">
    ----------------------------------------------------------------------
    editor.htm
    <script language=javascript>
    var name="ssm1226";
    </script>
    <input type=text name=txt value="ssm1226">