<ifram name="ss" src="s" id="name" runat="server" > </ifram >
<script lanuage="javascrpt" >
</script >后台:
if(条件1)
{
this.name.attributes.add("src","XXX");
}
else
{
this.name.attributes.add("src","YYY");
}
<script lanuage="javascrpt" >
</script >后台:
if(条件1)
{
this.name.attributes.add("src","XXX");
}
else
{
this.name.attributes.add("src","YYY");
}
解决方案 »
- 关于div的背景图片的问题
- 请问不使用form, 如何用HTML,JavaScript做前端,Asp.net作服务器端实现文件上传?
- 为什么在代码中按Enter后,网页的内容就显示不了?
- 在地址栏可以执行该页面里面的JS吗?
- js 帮看看
- constructor的困惑
- 给资料了!
- <input type=file name="FileName" onclick="openfile()"> 我想用openfile()来控制打开选择文件的对话框,怎么实现?谢谢!
- 如何用javascript语言编写用enter键和上下左右键控制Textbox内的焦点问题?给出正确代码给满分。
- for循环读取i值
- 在form中动态添加<input type="text">元素
- 关于事件处理程序的this指针问题
<script lanuage="javascrpt" >
</script >
上面我又给了一个ID的属性然后在JS里可以这样控制getElementByid("ss").src="动态路径"
光凭客户端是办不到的~~~
<script lanuage="javascrpt">
tips=new Array(2);
tips[0]="http://www.sina.com.cn";
tips[1]="http://www.baidu.com"
index=Math.floor (Math.random ()*tips.length);
document.all.iframeName.src=tips[index];
</script>通过查找了点资料写了上面的代码
目前我只能做到手动刷新来随即改变ifram中src的变化,谁知道,设定一个变量来实现浏览器的固定时间的刷新..
function freshFrame()
{
tips=new Array(2);
tips[0]="http://www.sina.com.cn";
tips[1]="http://www.baidu.com"
index=Math.floor (Math.random ()*tips.length);
document.all.iframeName.src=tips[index];
}
setInterval("freshFrame",5000);//5秒刷新一次
</script >
<script lanuage="javascrpt">
tips=new Array(2);
tips[0]="http://www.baidu.com";
tips[1]="http://www.sina.com";
index=Math.floor (Math.random ()*tips.length);
document.all.iframeName.src=tips[index];
setInterval("refreshFrame()",5000);
function refreshFrame()
{
index=Math.floor (Math.random ()*tips.length);
document.getElementById('iframeName').src=tips[index];
}
</script>
多谢楼上的几位帮忙