asp关于sub 调用的一点问题
a1.asp源码大概如下subaaa(a,b)............ifabc=0thenresponse.write"<scriptlanguage='javascr...
a1.asp 源码大概如下
sub aaa(a,b)
......
......
if abc=0 then
response.write "<script language='javascript'>" & chr(13)
response.write "alert('即将关闭!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
end if
end sub
而我在另一个页面a2.asp里调用的代码大楖如下
<!--#Include File="a1.Asp"-->
abc=0
call aaa(1,2)
.......
.......
response.write "<script language='javascript'>" & chr(13)
response.write "alert('朋友你好!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
......
......
按说我在执行a2.asp的时候,应该出现“即将关闭”然后就关闭窗口了,但实际上总是在显示“即将关闭”后,点完确定,又出现“朋友你好”,再点完确定窗口才关闭,求达人指点迷津,让显示“即将关闭”后,立即关闭窗口,不要显示“朋友你好” 展开
sub aaa(a,b)
......
......
if abc=0 then
response.write "<script language='javascript'>" & chr(13)
response.write "alert('即将关闭!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
end if
end sub
而我在另一个页面a2.asp里调用的代码大楖如下
<!--#Include File="a1.Asp"-->
abc=0
call aaa(1,2)
.......
.......
response.write "<script language='javascript'>" & chr(13)
response.write "alert('朋友你好!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
......
......
按说我在执行a2.asp的时候,应该出现“即将关闭”然后就关闭窗口了,但实际上总是在显示“即将关闭”后,点完确定,又出现“朋友你好”,再点完确定窗口才关闭,求达人指点迷津,让显示“即将关闭”后,立即关闭窗口,不要显示“朋友你好” 展开
展开全部
整个页面已经加载到内存中了,所以你点击了确定后还会从内存中往下执行。如果你想终止的话可以在
if abc=0 then
response.write "<script language='javascript'>" & chr(13)
response.write "alert('即将关闭!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
end if
后面加上下面的语句
response.end
if abc=0 then
response.write "<script language='javascript'>" & chr(13)
response.write "alert('即将关闭!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
end if
后面加上下面的语句
response.end
参考资料: http://www.biye5u.com/article/
展开全部
a2中无需再写以下代码了:
response.write "<script language='javascript'>" & chr(13)
response.write "alert('朋友你好!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
response.write "<script language='javascript'>" & chr(13)
response.write "alert('朋友你好!');" & Chr(13)
response.write "window.close();"&Chr(13)
response.write "</script>" & Chr(13)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询