帮忙看看这段代码哪有问题,为什么取不到值

5icool 2004-09-02 10:25:07
<%
adurl="ad.htm"
width="250"
height="150"
Response.Write("<script>window.open('""&adurl&""','ad','scrollbars=yes,resizable=yes,width=""&width&"",height=""&height&""')</script>")
%>
...全文
66 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
xihasky 2004-09-02
  • 打赏
  • 举报
回复
还真的是这样.可是这是为什么呢?
5icool 2004-09-02
  • 打赏
  • 举报
回复
本来我是 "&adurl&" 的,写成 "& adurl &" 就OK了,其他一样

大家以后注意了
dsclub 2004-09-02
  • 打赏
  • 举报
回复
怎么 雪村 不唱歌了?也不集邮票了?搞asp了?
dsclub 2004-09-02
  • 打赏
  • 举报
回复
&h 后,就按16进制处理了!
xczjl 2004-09-02
  • 打赏
  • 举报
回复
是啊!这个问题我也遇见过的!上次还查了很长时间呢!
5icool 2004-09-02
  • 打赏
  • 举报
回复
我靠!我自己解决了,这样就可以了

Response.Write("<script>window.open('"& adurl &"','ad','scrollbars=yes,resizable=yes,width="& width &",height="& height &"')</script>")

加空格,希望大家以后遇到这样的情况能用的到
xihasky 2004-09-02
  • 打赏
  • 举报
回复
括号的问题啊!!!
5icool 2004-09-02
  • 打赏
  • 举报
回复
按照道理是没错

可去掉以后
Microsoft VBScript 编译器错误 错误 '800a03ee'

缺少 ')'

/a.asp,行5

Response.Write("<script>window.open('"&adurl&"','ad','scrollbars=yes,resizable=yes,width="&width&",height="&height&"')</script>")

但如果加上不报错,就是取不到值
xihasky 2004-09-02
  • 打赏
  • 举报
回复
<%
adurl="ad.htm"
width="250"
height="150"
Response.Write("<script> window.open('"&adurl&"','ad','scrollbars=yes,resizable=yes,width="&width&",height="&height&"') </script>")
%>

这样应该没错.
5icool 2004-09-02
  • 打赏
  • 举报
回复
我是所加了""

但如果不加会出错的
mjpclab 2004-09-02
  • 打赏
  • 举报
回复
Response.Write("<script>window.open('"&adurl&"','ad','scrollbars=yes,resizable=yes,width="&width&",height="&height&"')</script>")
xihasky 2004-09-02
  • 打赏
  • 举报
回复
引号的问题啊!

28,390

社区成员

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

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