I have more DIVs like this:
<span class="date">Fri November 9, 2012</span>
All these are in a var.
Example:
var = '
...<span class="date">Fri November 9, 2012</span>...
...<span class="date">Fri November 9, 2012</span>...
';
I try to replace each date with a image that contain this date.
I have this line but this didn’t works:
ver = ver.replace(/<span class="date">(.*)<\/span>/g,'<span class="date"><img src="generateLink.php?nr='+encodeURIComponent($1)+'" /></span>');
My question is: I can’t use encodeURIComponent in regex?
Use replace with callback function
And can be more simple