求助js脚本中字符串的写法?

xucb 2003-12-27 12:21:34
一个字符串太长,我要用两行来写,请问如何写?
...全文
33 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
bzscs 2003-12-27
  • 打赏
  • 举报
回复
sqlstr = "select * from xt_mkb where supper="+nodeID+" and id in (select id from xt_mkb where userid="+userID+" and js=2)"

sqlstr = sqlstr + "union"

sqlstr = sqlstr + "select * from xt_mkb where supper="+nodeID+" and id in (select supper from xt_mkb where userid="+userID+" and js=3)"
.........
xucb 2003-12-27
  • 打赏
  • 举报
回复
我是这么写的,但不成功
sqlstr = "select * from xt_mkb where supper="+nodeID+" and id in (select id from xt_mkb where userid="+userID+" and js=2)"+
"union"+
"select * from xt_mkb where supper="+nodeID+" and id in (select supper from xt_mkb where userid="+userID+" and js=3)"+
"union"+
"select * from xt_mkb where supper="+nodeID+" and id in (select supper from xt_mkb where id in (select supper from xt_mkb where userid="+userID+" and js=4))"+
"union"+
"select * from xt_mkb where supper="+nodeID+" and id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where userid="+userID+" and js=5)))"+
"union"+
"select * from xt_mkb where supper="+nodeID+" and id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper* from xt_mkb where userid="+userID+" and js=6))))"+
"union"+
"select * from xt_mkb where supper="+nodeID+" and id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where userid="+userID+" and js=7)))))"+
"union"+
"select * from xt_mkb where supper="+nodeID+" and id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where id in (select supper from xt_mkb where userid="+userID+" and js=8))))))"
xdspower 2003-12-27
  • 打赏
  • 举报
回复
可以用+号来连接啊.
ccton 2003-12-27
  • 打赏
  • 举报
回复
写成这个样子,没有不成功的:
x="hishguirehwugiherw"
+"..."
+"..."

...

+"...";

每个引号里面的玩意都不能换行。

87,904

社区成员

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

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