title: Javascript Bookmarklets with Quotes
body: <p>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,  </p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Temporary HTML Doc&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;a href="javascript:(function(){var a='something';var d='something_else'}());"&gt;Link&lt;/a&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>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  </p>
  
  <pre><code>&lt;a href='javascript:(function(){var a="something";var d='something_else'}());"&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;a href="javascript:(function(){var a="something";var d='something_else'}());"&gt;
  </code></pre>
  
  <p>, it is still cut off, and the link becomes useless.  </p>
  
  <p>So, how can I include code that requires <code>""</code> and <code>''</code> quotes to work?<br>
  This example isn't my actual code, but it should hold for this problem.</p>
  
  <p><a href="http://en.wikipedia.org/wiki/Bookmarklet" rel="nofollow">Wikipedia's page on Bookmarklets</a></p>