<div id="div1">&nbsp;
</div>
<script language=javascript>
var o = document.getElementById('div1');
var obj = document.createElement('iframe');
obj.width = '100%';
obj.height = '100%';
obj.src = '时间.htm';
obj.name="iframe1"
o.appendChild(obj);
</script>
<input name=button1 type=button value="换" onclick="obj.src='3.htm'">

解决方案 »

  1.   

    <script language="JavaScript">
    <!--
    window.onload=function()
    {
    var o = document.getElementById('div1');
    var obj = document.createElement('iframe');
    obj.width = '100%';
    obj.height = '100%';
    obj.src = 'sss.htm';
    o.appendChild(obj);
    }
    function jump(url)
    {
    var frame=document.frames[0];
    frame.location.href=url;
    }//-->
    </script>
    <div id="div1"></div>
    <input type="button" value="跳到google" onclick="jump('http://www.google.com')">
      

  2.   

    obj.location或者obj.location.href应该都可以