Bit of Javascript Hell
darryl
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:
When all I really want is this:
http://gladlee.smugmug.com/photos/212727446-Th.jpg
What's odd is that I'm using this:
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.
My problem right now is I have the description string from the RSS, which is a bunch of stuff like this:
<p><a href="http://gladlee.smugmug.com">G & D</a> updated gallery '<a href="http://gladlee.smugmug.com/gallery/3711094">Santa Cruz</a>'</p><p><a href="http://gladlee.smugmug.com/gallery/3711094" title="Santa Cruz"><img src="http://gladlee.smugmug.com/photos/212727446-Th.jpg" width="" height="" alt="Santa Cruz" title="Santa Cruz" style="border: 1px solid #000000;" /></a></p></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.
0