Bit of Javascript Hell

darryldarryl Registered Users Posts: 997 Major grins
So on http://gladlee.smugmug.com/, I'm working on a recent galleries AJAX-RSS hack. It's very close (although I think I'm going to have to move it out of the Bio box because the miniboxes don't seem to work properly within a userbio div)...

My problem right now is I have the description string from the RSS, which is a bunch of stuff like this:
&lt;p&gt;&lt;a href=&quot;http://gladlee.smugmug.com&quot;&gt;G &amp; D&lt;/a&gt; updated gallery '&lt;a href=&quot;http://gladlee.smugmug.com/gallery/3711094&quot;&gt;Santa Cruz&lt;/a&gt;'&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://gladlee.smugmug.com/gallery/3711094&quot; title=&quot;Santa Cruz&quot;&gt;&lt;img src=&quot;http://gladlee.smugmug.com/photos/212727446-Th.jpg&quot; width=&quot;&quot; height=&quot;&quot; alt=&quot;Santa Cruz&quot; title=&quot;Santa Cruz&quot; style=&quot;border: 1px solid #000000;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>

When all I really want is this:
http://gladlee.smugmug.com/photos/212727446-Th.jpg

What's odd is that I'm using this:
        var galimage = RSS.items[i].description ;
        var galimage = galimage.replace(/^.*img src=(.*?) .*/, "$1") ;

And I end up with this very bizarre thing where 1) Firebug claims "RSS.items has no properties" wrt to description, and 2) the image url is getting split at slashes, into this:

<img class="imgBorder" 212727446-th.jpg="" photos="" gladlee.smugmug.com="" http:="" src=""/>

I'm totally stumped at this point, but then I'm totally hacking, since I don't actually know Javascript.
Sign In or Register to comment.