日期:2014-05-17  浏览次数:21096 次

ASP代码问题...希望知道的帮一下.
xShow = xShow & "[<a href="&Setting(1)&"dl.asp>登录</a>|<a href="&Setting(1)&"zc.asp>注册</a>] 
原先这样可以显示 登陆|注册

修改为下面代码不能显示了.
xShow = xShow & "[<a href="&Setting(1)&"dl.asp>登录</a>|<a href="&Setting(1)&"zc.asp>注册</a>] [<a onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.XXX.com/');" href="#">设为首页</a>|<a href="javascript:myAddPanel('XXX网'http://www.XXX.com/','http://www.XXX.com/')">加入收藏</a>]"

求解...谢谢了.

------解决方案--------------------
在ASP里面如果要表示引号,要用2个引号表示一个

<%xShow = xShow & "[<a href="&Setting(1)&"dl.asp>登录</a>|<a href="&Setting(1)&"zc.asp>注册</a>] [<a onClick=""this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.XXX.com/');"" href=""#"">设为首页</a>|<a href=""javascript:myAddPanel('XXX网'http://www.XXX.com/','http://www.XXX.com/')"">加入收藏</a>]"%>
------解决方案--------------------
xShow = xShow & "[<a href="&Setting(1)&"dl.asp>登录</a>|<a href="&Setting(1)&"zc.asp>注册</a>] [<a onClick=""this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.XXX.com/');"" href=""#"">设为首页</a>|<a href=""javascript:myAddPanel('XXX网','http://www.XXX.com/','http: //www.XXX.com/')"">加入收藏</a>]"
------解决方案--------------------
试试:
<%
xShow = xShow & "[<a href="""& Setting(1) &"""dl.asp>登录</a>|<a href="""& Setting(1) &"""zc.asp>注册</a>] [<a onClick=""this.style.behavior = 'url(#default#homepage)';this.setHomePage('http://www.XXX.com/');"" href=""#"">设为首页</a>|<a href=""javascript:myAddPanel('XXX网',http://www.XXX.com/','http://www.XXX.com/')"">加入收藏</a>]"
%>
------解决方案--------------------
为什么我测试可以。我2

测试文件:index.asp
VB code
<%
Dim xShow,xText
xShow = ""
xText = "http://www.baidu.com"
xShow = xShow & "[<a href="""& xText &"""dl.asp>登录</a>|<a href="""& xText &"""zc.asp>注册</a>] [<a onClick=""this.style.behavior = 'url(#default#homepage)';this.setHomePage('http://www.XXX.com/');"" href=""#"">设为首页</a>|<a href=""javascript:myAddPanel('XXX网',http://www.XXX.com/','http://www.XXX.com/')"">加入收藏</a>]"
Response.Write(xShow)
%>