I have an anchor like this in my website:
<a href="javascript:OpenNewWindow('/PhotoDetails.asp?ProductCode=ProductCode', 640, 480)" title="">
Using jQuery, how would it be possible to replace javascript:OpenNewWindow('/PhotoDetails with /ProductDetails and replace ', 640, 480) with nothing?
I tried .replace but it’s complicated since theres single quotes in the content.
Thanks.
I’m not a regex guru, but here is a simple indexOf solution using the single quotes as boundaries.
http://jsfiddle.net/CWjV5/3