请问在同一页面里,如何在VBSCRIPT函数中嵌入ASP脚本,同时在ASP脚本中引用函数中定义变量啊?

alexjkd 2003-09-13 02:06:43
如题
请问在同一页面里,如何在VBSCRIPT函数中嵌入ASP脚本,同时在ASP脚本中引用函数中定义变量啊?
...全文
44 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
celerylhl 2003-09-13
  • 打赏
  • 举报
回复
看一下这段代码,我写的。
ttt2 2003-09-13
  • 打赏
  • 举报
回复
<script language="vbscript">
sub a
messagebox(<%="hellow"%>)
end sub
</script>



response.write "<script language='vbscript'>a()</script>"
celerylhl 2003-09-13
  • 打赏
  • 举报
回复
<script language=vbscript>
sub changeselect(x)


j=document.all.messager.font.length-1
for i=j to 0 step -1
document.all.messager.font.remove(i)
next

set ooption=document.createelement("option")
ooption.text="---请选择收件人---"
ooption.value="CELERY"
document.all.messager.font.add(ooption)

<%
sql="select dept_name,dept_no from hes_dept where length(dept_no )='"&Session("deptlen")&"'"
set ks=conn.execute(sql)
while not ks.eof
%>
if strcomp(x,"<%=ks(1)%>")=0 then
<%
sql="select b.user_name user_name,c.user_desc user_desc,a.name name from HES_EMPLOYEE a,user_emp b,user_tab c where a.dept_no='"+ks(1)+"' and b.emp_no=a.employee_no and c.user_name=b.user_name"
set hoho=conn.execute(sql)
while not hoho.eof
%>
set ooption=document.createelement("option")
ooption.text="<%=hoho("user_name")%>--<%=hoho("user_desc")%>--<%=hoho("name")%>"
ooption.value="<%=hoho("user_name")%>"
document.all.messager.font.add(ooption)
<%
hoho.movenext
wend
%>
end if
<%
ks.movenext
wend
%>

end sub
</script>
celerylhl 2003-09-13
  • 打赏
  • 举报
回复

<script language=vbscript>
sub changeselect(x)


j=document.all.messager.font.length-1
for i=j to 0 step -1
document.all.messager.font.remove(i)
next

set ooption=document.createelement("option")
ooption.text="---请选择收件人---"
ooption.value="CELERY"
document.all.messager.font.add(ooption)

<%
sql="select dept_name,dept_no from hes_dept where length(dept_no )='"&Session("deptlen")&"'"
set ks=conn.execute(sql)
while not ks.eof
%>
if strcomp(x,"<%=ks(1)%>")=0 then
<%
sql="select b.user_name user_name,c.user_desc user_desc,a.name name from HES_EMPLOYEE a,user_emp b,user_tab c where a.dept_no='"+ks(1)+"' and b.emp_no=a.employee_no and c.user_name=b.user_name"
set hoho=conn.execute(sql)
while not hoho.eof
%>
set ooption=document.createelement("option")
ooption.text="<%=hoho("user_name")%>--<%=hoho("user_desc")%>--<%=hoho("name")%>"
ooption.value="<%=hoho("user_name")%>"
document.all.messager.font.add(ooption)
<%
hoho.movenext
wend
%>
end if
<%
ks.movenext
wend
%>

end sub
</script>
celerylhl 2003-09-13
  • 打赏
  • 举报
回复

<script language=vbscript>
sub changeselect(x)


j=document.all.messager.font.length-1
for i=j to 0 step -1
document.all.messager.font.remove(i)
next

set ooption=document.createelement("option")
ooption.text="---请选择收件人---"
ooption.value="CELERY"
document.all.messager.font.add(ooption)

<%
sql="select dept_name,dept_no from hes_dept where length(dept_no )='"&Session("deptlen")&"'"
set ks=conn.execute(sql)
while not ks.eof
%>
if strcomp(x,"<%=ks(1)%>")=0 then
<%
sql="select b.user_name user_name,c.user_desc user_desc,a.name name from HES_EMPLOYEE a,user_emp b,user_tab c where a.dept_no='"+ks(1)+"' and b.emp_no=a.employee_no and c.user_name=b.user_name"
set hoho=conn.execute(sql)
while not hoho.eof
%>
set ooption=document.createelement("option")
ooption.text="<%=hoho("user_name")%>--<%=hoho("user_desc")%>--<%=hoho("name")%>"
ooption.value="<%=hoho("user_name")%>"
document.all.messager.font.add(ooption)
<%
hoho.movenext
wend
%>
end if
<%
ks.movenext
wend
%>

end sub
</script>

28,391

社区成员

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

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