<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>I am trying to replace a image.src with the url from it's background image.

&lt;pre&gt;
var img = document.evaluate(&quot;//img[contains(@src, 'clear.cache.gif')]&quot;,document,null,9,null).singleNodeValue;
var imgbackground = img.style.background;
img.src = imgbackground;
&lt;/pre&gt;

imgbackground returns &quot;transparent url(show.image.jpg) no-repeat scroll center center&quot;; how do I just get &quot;show.image.jpg&quot; from transparent url instead?

The Html example I am trying to modify is:

&lt;pre&gt;
&amp;lt;img class=&quot;imageViewMainImage&quot; src=&quot;clear.cache.gif&quot; style=&quot;background: transparent url(show.image.jpg) no-repeat scroll center center; 
height: 500px; width: 500px; visibility: visible; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; 
-moz-background-inline-policy: -moz-initial;&quot; title=&quot;Use your mousewheel to navigate the image gallery.&quot;/&amp;gt;
&lt;/pre&gt;

Thanks!!! (sorry for my poor newbie code)</body>
  <body-html>&lt;p&gt;I am trying to replace a image.src with the url from it's background image.&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
var img = document.evaluate(&quot;//img[contains(@src, 'clear.cache.gif')]&quot;,document,null,9,null).singleNodeValue;
var imgbackground = img.style.background;
img.src = imgbackground;
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;imgbackground returns &quot;transparent url(show.image.jpg) no-repeat scroll center center&quot;; how do I just get &quot;show.image.jpg&quot; from transparent url instead?&lt;/p&gt;

&lt;p&gt;The Html example I am trying to modify is:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
&amp;lt;img class=&quot;imageViewMainImage&quot; src=&quot;clear.cache.gif&quot; style=&quot;background: transparent url(show.image.jpg) no-repeat scroll center center; 
height: 500px; width: 500px; visibility: visible; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; 
-moz-background-inline-policy: -moz-initial;&quot; title=&quot;Use your mousewheel to navigate the image gallery.&quot;/&amp;gt;
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Thanks!!! (sorry for my poor newbie code)&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-10-22T02:11:34Z</created-at>
  <forumable-id type="integer">1</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">16445</id>
  <topic-id type="integer">9453</topic-id>
  <updated-at type="datetime">2008-10-22T02:20:18Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">70280</user-id>
</post>
