How can I extract a URL from url("http://www.example.com")?
<p>I need to get the URL of an element's background image with jQuery:</p>

<pre><code>var foo = $('#id').css('background-image');
</code></pre>

<p>This results in something like <code>url("http://www.example.com/image.gif")</code>.  How can I get just the "http://www.example.com/image.gif" part from that?  <code>typeof foo</code> says it's a string, but the <code>url()</code> part makes me think that JavaScript and/or jQuery has a special URL type and that I should be able to get the location with <code>foo.toString()</code>.  That doesn't work though.</p>
