Reputation: 1435
I have an URL that looks like this :
http://www.blabla.com/../images/wow.jpg
I would like to remove the double dots and slash and I thought I could do it this way :
var img = IMAGE_PATH + url;
var image = img.replace(/\.{2}\//,'');
But that's not doing anything. Could someone please tell me how I could do this in jquery ?
Thanks
Upvotes: 0
Views: 47
Reputation: 125
Try this (no jQuery needed):
var s = 'http://www.blabla.com/../images/wow.jpg'.replace('../','');
Upvotes: 1