您的位置:首页 > Web前端 > JavaScript

小黑小波比.JSHint常见错误解决

2014-10-22 19:47 155 查看
1.错误信息:



2.Bad line breaking before '+'.

错误代码:

"infos_getsubscrib": {
		sql: "select * from events t"
		+" left join (select count(*) as sends,ecode from events_push group by ecode) b"
		+" on t.ecode= b.ecode"
		+" left join (select count(*) as count,ecode from events_push where status = 1 group by ecode) c"
		+" on t.ecode = c.ecode"
		+" where t.revent=:revent"
	},
正确代码:

"infos_getsubscrib": {
		sql: ["select * from events t",
		" left join (select count(*) as sends,ecode from events_push group by ecode) b",
		" on t.ecode= b.ecode",
		" left join (select count(*) as count,ecode from events_push where status = 1 group by ecode) c",
		" on t.ecode = c.ecode",
		" where t.revent=:revent"].join(" ")
	},


3.The array literal notation [] is preferbale.

错误代码:

var rowsarr = new Array();


正确代码:

var rowsarr = [];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: