如何用javascript写出通过onclick事件改变iframe的src? <a href="javascript:document.test.location.href='inner2.htm';return false;">改变</a> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <a href="javascript:void(0);document.test.location='inner2.htm';">改变</a>好象是这样把 试试这个:<a href="javascript:document.getElementById("test").src='inner2.htm';"> <a href="javascript:test.location.href='inner2.htm'">改变</a>OK! 研究研究下面这段程序就明白了!<html><head><meta http-equiv="Content-Language" content="en-us"><title>button_title_l</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script>function oa_tool(){if(window.parent.oa_frame1.cols=="120,10,*"){frameshow.src="images/p_2.gif";oa_tree.title="隐藏菜单栏"window.parent.oa_frame1.cols="0,10,*";}else{frameshow.src="images/p_1.gif";oa_tree.title="显示菜单栏"window.parent.oa_frame1.cols="120,10,*";}}</script><base target="_self"><meta name="Microsoft Theme" content="none"></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFE8DD"><div align="left"><table width="7" border="0" height="100%" cellpadding="0" cellspacing="0" align="left" style="border-collapse: collapse" > <tr align="center"> <td width="10" height="100%"> <div id=oa_tree onclick="oa_tool();" title=隐藏菜单栏 style="width: 10; height:55"> <img id=frameshow src="images/p_2.gif" border="0" width="9" height="50" > </div> </td> </tr> </table></div></body></html> <a href="javascript:test.location.href='inner2.htm'">改变</a>OK!这个就是了,结贴吧。 <script>function cc(){document.all['test'].src="5.htm";}</script><Iframe src="1.htm" name=test id="test" width="250" height="200" scrolling="no" BORDER="0" frameborder="1"></iframe><font color=red onclick="cc()">changeurl</font> 利用Javascript绘制坐标曲线图的问题!!十万火急啊!! 用JS如何现实骰子数目的随机选取? 无聊,修改了下前几天发布的那个小东西 关于对JavaScript的学习 fckeditor 怎么去掉里面的各个提示框中的上传标签 小弟刚刚接触JS,有个非常简单的问题要问! 怎么在父窗体A调用子窗体B的函数? 关于arcgis10.1中几何服务的问题 漫画Jquery弹出层插件,如何自己写关闭事件? window.open(马上给分) 层的绝对定位什么做(不随刷新频率而改变)? 同志们,求救!
好象是这样把
<a href="javascript:document.getElementById("test").src='inner2.htm';">
OK!
<html>
<head>
<meta http-equiv="Content-Language" content="en-us"><title>button_title_l</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function oa_tool(){
if(window.parent.oa_frame1.cols=="120,10,*"){
frameshow.src="images/p_2.gif";
oa_tree.title="隐藏菜单栏"
window.parent.oa_frame1.cols="0,10,*";
}
else{
frameshow.src="images/p_1.gif";oa_tree.title="显示菜单栏"
window.parent.oa_frame1.cols="120,10,*";}
}
</script>
<base target="_self">
<meta name="Microsoft Theme" content="none">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFE8DD">
<div align="left">
<table width="7" border="0" height="100%" cellpadding="0" cellspacing="0" align="left" style="border-collapse: collapse" >
<tr align="center">
<td width="10" height="100%">
<div id=oa_tree onclick="oa_tool();" title=隐藏菜单栏 style="width: 10; height:55">
<img id=frameshow src="images/p_2.gif" border="0" width="9" height="50" >
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
OK!
这个就是了,结贴吧。
<script>
function cc()
{
document.all['test'].src="5.htm";}</script>
<Iframe src="1.htm" name=test id="test" width="250" height="200" scrolling="no" BORDER="0" frameborder="1">
</iframe>
<font color=red onclick="cc()">changeurl</font>