我只想将基本 url 传递给 javaScript 函数。函数调用如下
<img src="assets/images/c_arow_rite.jpg" onClick="nextMonth('.$bs_url.')"/>
它在错误控制台中显示错误,例如
Error: SyntaxError: identifier starts immediately after numeric literal
Source File: `http://mywebsite/rand/`
Line: 1, Column: 15
Source Code:
nextMonth(http%3A%2F%2F192.168.1.254%2Frand%2F)