I wrote a javascript bookmarklet which works well. It is rather long and it contains many single and double quotation marks as in the following toy example:
javascript:html="<a href='www.example.com'>example</a>";document.write(html);
Now I have to publish it on a web page, that is, I have to insert the javascript string as the url attribute inside an < a > tag in the html source code of the page, so:
<a href="javascript:...">this is my bookmarklet</a>
but obviously there is a conflict due to repeated double quotation marks. Is there any simple way I can write the bookmarklet javascript code inside an html code?
This bookmarklet generator was created in 2012 and still works great today: https://mrcoles.com/bookmarklet/