<script>x = window.open('http://baidu.com?id='123''); void (x);</script>
我想把'123' 参数也传过去,怎样做?谢谢.
其实我是想实现这个的var strsql="aopp_aopportunityid in(select cwop_recordid from
cworkflowprogress where cwop_entityname='aopportunity' and ((cwop_userid=175)))";//这个字符串是从数据库读取的Response.write("<script>x = window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project2%2fReport2&rs%
3aCommand=Render&rc%3aParameters=ture&strsql=" + strsql + "');void (x);</script>");
把它合并起来就是下面这句话了:Response.write("<script>x = window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project2%2fReport2&rs%
3aCommand=Render&rc%3aParameters=ture&strsql=aopp_aopportunityid in(select cwop_recordid from
cworkflowprogress where cwop_entityname='aopportunity' and ((cwop_userid=175)))');void (x);</script>");上面代码一运行时,就报"缺少)"错误.我想问题一定出现在cwop_entityname='aopportunity' 的''符号上.怎样解决这个问题,能不能用正则表达式去实现它.让它变得可行.或者有什么好的解决办法???谢谢.
传参数时不需要加引号
的'aopportunity'先变成一个字符串,然后再把它给合起来.这种方法可行吗?谢谢
的'aopportunity'先变成一个字符串,然后再把它给合起来.
用UrlEncode()怎样整,谢谢
直接这样就行了
服务端用server.UrlEncode(你要加密的字串)
客户端JS:用 escape(你要加密的字串)试一下
这句话<script>x = window.open("http://baidu.com?id='123'"); void (x); </script> 的"http://baidu.com?id='123'" 双引号在这里Response.write("<script>x = window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project2%2fReport2&rs%
3aCommand=Render&rc%3aParameters=ture&strsql=aopp_aopportunityid in(select cwop_recordid from
cworkflowprogress where cwop_entityname='aopportunity' and ((cwop_userid=175)))');void (x);</script>");已经用过了,再用就有冲突了吧?谢谢.
客户端JS你放这里,服务器代码你也放在这里,别人无法准确理解你的意思哦
建议:你还是用HTML来发你的代码吧,不然每次都把人搞的稀里糊涂的,哈<%
dim sql
sql="aopp_aopportunityid in(select cwop_recordid from cworkflowprogress where cwop_entityname='aopportunity' and ((cwop_userid=175)))"
Response.write("<script>x = window.open('http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project2%2fReport2&rs%
3aCommand=Render&rc%3aParameters=ture&strsql=server.URLEncode(sql)');void (x);</script>");%>
<%
dim url,sql
sql="aopp_aopportunityid in(select cwop_recordid from cworkflowprogress where cwop_entityname='aopportunity' and ((cwop_userid=175)))"
url=server.URLEncode("http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project2%2fReport2&rs%
3aCommand=Render&rc%3aParameters=ture&strsql=sql") Response.write("<script>x = window.open('"&url&"');void (x);</script>");%>