[Javascript] Listing Images on current page

Terry Bader bader at tcbader.com
Thu Sep 6 11:21:55 CDT 2007


thats only one of the many many things you can do...  

and if you havent been introduced to it, then check it out...

----------------------------------------
From: "   Nick Fitzsimons" <nick at nickfitz.co.uk>
Sent: Thursday, September 06, 2007 12:17 PM
To: "'JavaScript List'" <javascript at lists.evolt.org>
Subject: Re: [Javascript] Listing Images on current page 

> You could do this using a library like jquery...  
> 

Loading a 20K library seems a little excessive for such a trivial task:

var list = document.createElement("ul");
document.body.appendChild(list);
var stuff = document.getElementsByTagName("img");
for (var i = 0, limit = stuff.length; i < limit; i++) {
   list.appendChild(document.createElement("li"));
   list.lastChild.appendChild(document.createTextNode(stuff[i].src));
}

Regards,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/

_______________________________________________
Javascript mailing list
Javascript at lists.evolt.org
http://lists.evolt.org/mailman/listinfo/javascript


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070906/93f7e1f9/attachment.htm>


More information about the Javascript mailing list