I have the following codes:
if(window.location.pathname.search(/\?/) != -1)
{
var refUrl = window.location.pathname.strip(/\?/);
}
else
{
var refUrl = window.location.pathname;
}
var pathname = refUrl += '/' + 'hey' + '/' + 'what';
alert(refUrl);
I'm running a check to see if there are any characters in the pathname, if so, strip it out.
The output is :
/_display//hey/what
So basically it didn't strip anything characters out from the pathname after testing this on jsfiddle. Can someone please tell me what's wrong with it?
Thank you,
halben