title: Setting background-image with javascript
body: <p>In chrome, safari, and opera setting the background image to an absolute reference such as: "/images/image.png" changes it to "<a href="http://sitepath/images/image.png" rel="nofollow noreferrer">http://sitepath/images/image.png</a>".</p>
  
  <p>It does not do this in firefox.</p>
  
  <p>Is there any way to avoid this behavior, or is it written into the browser's javascript engine? Using jquery to set the background-image also does this problem.</p>
  
  <p>The problem is that I am posting the HTML to a php script that needs the urls in this specific format. I know that setting the image path relative fixes this, but I can't do that.</p>
  
  <p>The only other alternative would be to use a regexp. to convert the urls.</p>
  
  <p>Thanks.</p>
  
  <p>Test this in firefox, and chrome / webkit browser:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div style="height:400px;width:400px;background-image:url(/images/images/logo.gif);"&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;div id="test" style="height:400px;width:400px;"&gt;
  &lt;/div&gt;
  &lt;script type="text/javascript" src="/javascripts/jquery.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          $("#test").css('background-image',"url(/images/images/logo.gif)");
          alert(document.getElementById('test').style.backgroundImage);
      });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>