I am using jQuery to capture an encoded URL.
I looks something like: #?var=asdasdasdasdasd
I need to strip “#?” at the beginning of the string. In PHP I’d use ltrim. How can I do this with jQuery or plain JS?
$("#myLink").click(function(){
var myUrl = $(this).attr("href");
var cleanUrl = ....
}
You could use replace method.