iframe动态添加SRC如何添加

来源:百度知道 编辑:UC知道 时间:2024/05/26 05:22:23

本页链接写法:
<a href="本页.asp?src=1">a.asp</a>
<a href="本页.asp?src=2">b.asp</a>
先获得其链接传过来的参数:
<%
dim srcnum=request.querystring("src")
dim srcstring=""
if srcnum=1 then
srcstring="a.asp"
elseif srcnum=2 then
srcstring="b.asp"
elseif srcnum=3 then
srcstring="c.asp"
end if
%>
然后在IFRAME中引用
<iframe name="ifra" src=<%=srcstring%> width="600"></ifame>
以上代码都写在本页的.

楼上方法为正解之一,下面我再给一种.

新建一个网页文件,代码如下:
<a href="http://www.baidu.com" target="main">框架中的百度</a> | <a

href="http://www.sina.com.cn" target="main">框架中的新浪</a> | <a