Javascript Bookmarklets with Quotes

LimeGreen84

New Member
I have had a problem with making javascript bookmarklets where the code inside contains both \[code\]""\[/code\] quotes and \[code\]''\[/code\] quotes. Say for example, my code was as follows,

\[quote\]<!DOCTYPE HTML>
<html>
<head>
<title>
Temporary HTML Doc
</title>
</head>
<body>
<a href="javascript:(function(){var a="something";var d='something_else'}());">Link</a>
</body>
</html>
\[/quote\]

I would then proceed to open up the HTML file and drag the link to the bookmarks bar. But, since the code has \[code\]""\[/code\] and \[code\]''\[/code\] quotes, whether or not I write the link as \[code\]<a href='javascript:(function(){var a="something";var d='something_else'}());">\[/code\] or \[code\]<a href="javascript:(function(){var a="something";var d='something_else'}());'>\[/code\], it is still cut off, and the link becomes useless.

So, how can I include code that requires \[code\]""\[/code\] and \[code\]''\[/code\] quotes to work? This example isn't my actual code, but it should hold for this problem.

Wikipedia's page on Bookmarklets
 
Back
Top