title: JQuery use value for location.href
body: <p>How to I use a JQuery value for a url to use with location.href?</p>
  
  <p>The url will be different every time the below url is an example.</p>
  
  <p>The URL is stored in the database as </p>
  
  <blockquote>
    <p>audit.php?audit=13957911461655047299&amp;page=summary</p>
  </blockquote>
  
  <p>Ajax is then used to retrieve the URL and save in a var called last_viewed so I would like to use the equivalent of</p>
  
  <pre><code>location.href = last_viewed
  </code></pre>
  
  <p>I have tried </p>
  
  <pre><code>location.href = '"'+last_viewed+'"'
  </code></pre>
  
  <p>but the URL becomes</p>
  
  <blockquote>
    <p><a href="http://www.x-rayqa.co.uk/" rel="nofollow">http://www.x-rayqa.co.uk/</a>"audit.php?audit=13957911461655047299&amp;page=summary"</p>
  </blockquote>
  
  <p>which obviously won't work because of the extra "s</p>
  
  <p>if I try just </p>
  
  <pre><code> location.href = last_viewed
  </code></pre>
  
  <p>nothing happens, the script is broken.</p>