Hey Eric

I understand what the function does, I am just not sure whether the search applies only to the current document or if you can pass in some DOM fragment e.g. the responseXML from an AJAX call..

I suspect not from trying it out and looking at the code but I am not certain...

Any thoughts welcome

Matt



Eric Anderson wrote:
Matt Spendlove wrote:
I am bit confused with this function. Should I be able to pass in a DOM element e.g. someAjaxRequest.responseXML and interrogate it ?

You can think of $$() as $() on steroids. Instead of simply taking an id and returning the element it will take a CSS selector and return all matching elements. So:

$$('#news .item')

will return all elements with "item" in the class names that are children of the element with id "news".

Eric

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to