如何使用javascript打开一个框架 [英] How to open a Frame using javascript

查看:77
本文介绍了如何使用javascript打开一个框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用javascript打开一个框架



i下面提到的代码。



请纠正我,如果我错了。



How to open a Frame using javascript

i Mentioned Code Below.

please correct me if i am wrong.

<script type="text/javascript">
function showError(msg) 
{
     alert(msg);
     document.getElementByID('frm2').src=msg;

}
 
 
  </script>





this是框架代码





this is Frame code

this is my frame code
 <iframe  id ="frm2" width="1200" height="1000" style="left: -8px; width: 1140px; position: relative; top: 20px; height: 680px" language="javascript"  önblur="return frm2_onblur()"></iframe>





推荐答案

通过这个解决方案你会明白

Go through this solution you will get idea
<HTML>
<HEAD>
<TITLE> Title Goes here </TITLE>
<script type="text/javascript">
var flag2=0;
function func2()
{
flag2=1;
parent.frames['one'].location="1.html";
parent.frames['two'].location="3.html";
}
</script></HEAD>
<FRAMESET rows="115,*">
            <FRAME SRC="1.html" ID="one" name="one">

            <FRAME SRC="2.html" ID="two" name="two">

</FRAMESET>

</HTML>
Then, 1.html:

<HTML>
<HEAD>
<TITLE> Cow goes Moo </TITLE>
</HEAD>
<body>
 One.html
    <input onclick="parent.func2();" id="Button1" type="button" value="button" />
</body>

</HTML>


这篇关于如何使用javascript打开一个框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆