大家进来看一下,一个传递参数的简单问题?

modou 2002-11-06 05:30:02
<script language="JavaScript" src="test.asp?width="+screen.width type="text/JavaScript"></script>

这样传递的变量width为什么得不到width的值?

我怎样可以使用上边的那种格式把屏幕的宽度传递到asp页面?

test.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
response.write "document.write('"&request.QueryString("width")&"')"
%>
...全文
36 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
modou 2002-11-06
  • 打赏
  • 举报
回复
谢谢了,已经成功,结贴
方工 2002-11-06
  • 打赏
  • 举报
回复
环境搞错了,HTML中没有+ 运算符和screen.width
flashsoft2000 2002-11-06
  • 打赏
  • 举报
回复
如果是在htm里面引用的话就这样
<script language="JScript">
document.write("<script language='JScript' src='userinfo.asp?color="+screen.colorDepth+"&screen="+screen.width+"×"+screen.height+"'><\/script>");
</script>

如果在asp里面的话
用上面的出错,说script重叠
但是可以这样解决
<%="<script language="JScript">"%>
document.write("<script language='JScript' src='userinfo.asp?color="+screen.colorDepth+"&screen="+screen.width+"×"+screen.height+"'><\/script>");
</script>

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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