I am creating a bookmarklet and I have to avoid using double quotes ( " ) because I have to include the bookmarklet inside a HTML page and it's inside a string that uses double quotes:
<a href="javascript:...">
In some places I have to use the code replace(/".*/, '');
In sed, I can escape double quotes using \x22
(22 is the ASCII hex code for double quotes)
Is it possible to do something similar in JavaScript like replace(/\x22.*/, '');
?
The same way you would use quotes in any HTML attribute's value.
example
<img src="..." alt="A picture of Bob "e;Wild Man" Johnson">
so for you
<a href="javascript:replace(/".*/, '');">