I just want to pass the base url to a javaScript function. Function call is like as follows
<img src="assets/images/c_arow_rite.jpg" onClick="nextMonth('.$bs_url.')"/>
It showing an error in the Error Console like
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)
location.href,location.host,location.pathname,location.protocol,location.port... there's a lot of info already available to you. If it's not the current url, then'quote the url'