用vbscript实现在FRAME1中让frame2变换窗口----如何实现,在线等待

m_leaner 2003-04-11 08:33:33
同上
...全文
38 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
wsj 2003-04-11
  • 打赏
  • 举报
回复
HTML

<script>
function aa()
{
if (queryString(location.href, "id")=="1")
parent.fram2.document.location.herf="1.asp"
if (queryString(location.href, "id")=="2")
parent.fram2.document.location.herf="1.asp"
}
function queryString(strURL, strParam)
{
var strVal = "";

try
{
// if strURL = "http://www.mySite.com/myPage.htm?param1=val1¶m2=val2"
var nIndex = strURL.indexOf("?");
if (nIndex > 0)
{
// cut strURL into "¶m1=val1¶m2=val2"
strURL = "&" + strURL.substring(nIndex + 1, strURL.length);
nIndex = strURL.indexOf("&"+ strParam + "=");
if(nIndex >= 0)
{
// jump to the position after the equal sign, if we're looking for
// param1, then strURL should contain 'val1¶m2=val2'
strURL = strURL.substring(nIndex + strParam.length + 2, strURL.length);

// in case there are other parameters followed
nIndex = strURL.indexOf("&");
if(nIndex == -1) //find the target
strVal = strURL;
else
strVal = strURL.substring(0, nIndex); // strVal should be 'val1' now
}
}
}
catch(e){}

return strVal;
}
</script>
<button onclick="aa()">根据参数跳转</button>
wsj 2003-04-11
  • 打赏
  • 举报
回复
ASP

<%
sub aa()
if request.querystring("id")="1" then
response.write "<scr"&"ipt>parent.fram2.document.location.herf='1.asp'</scr"&"ipt>"
response.end
end if
if request.querystring("id")="2" then
response.write "<scr"&"ipt>parent.fram2.document.location.herf='1.asp'</scr"&"ipt>"
response.end
end if
end sub

%>
m_leaner 2003-04-11
  • 打赏
  • 举报
回复
大哥们拜托了
m_leaner 2003-04-11
  • 打赏
  • 举报
回复
sub aa()
if request.querystring("id")="1" then
parent.fram2.document.location.herf="1.asp"
end if
if request.querystring("id")="2" then
parent.fram2.document.location.herf="2.asp"
end if
end sub
m_leaner 2003-04-11
  • 打赏
  • 举报
回复
这个问题我如何解决,我该怎么写阿,新手才一个角,帮个忙啊!
我的代码:
sub aa()
if request.querystring("id")="1" then
parent.fram2.document.location.herf="1.asp"
end if
if request.querystring("id")="2" then
parent.fram2.document.location.herf="2.asp"
end if
网页打开是现实有错误。
onclick="aa()"
wangyime 2003-04-11
  • 打赏
  • 举报
回复
当然有,是在客户端而不是在服务器端
saucer 2003-04-11
  • 打赏
  • 举报
回复
vbscript does not have this object, but DHTML DOM has it
m_leaner 2003-04-11
  • 打赏
  • 举报
回复
vbscript有parent这个对象吗?
xieyj 2003-04-11
  • 打赏
  • 举报
回复
parent.第二个frame.document.location.href=url
saucer 2003-04-11
  • 打赏
  • 举报
回复
use syntax like

parent.frames("frame2").location.href= "http://expert.csdn.net/Expert/topic/1607/1607521.xml"
wangyime 2003-04-11
  • 打赏
  • 举报
回复
<script language=vbscript>
parent.frame2name.document.location.href=url

</script>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧