views:

104

answers:

1

I have a Yahoo! Widgets Web object ( http://tinyurl.com/YW-webObj ) and I'd like to access elements inside of it when it's done loading. I'm already handling everything wonderfully via the WebEvents Y!W provides, but there's one small problem.

Web objects don't appear to have any DOM of their loaded page.

I can access webObj.html, which is the loaded page's source, but as a string.

I can't find anything to parse that html into a DOM object. XMLDOM.parse() is the only thing that matches 'parse' in the docs, and that's a no-go.

The Y!W docs say getElementById only is applicable to Frame, Window, and Widget objects internally ( http://tinyurl.com/YW-getElemById ). Is what I want to do (grab a page, get values by known ids in that page, do stuff with the values) not something Y!W wants you to do? Must I only interact with xml/json services?

+1  A: 

You can access the Web object's document like so:

document.getElementById('WebObjectID').base.document.getElementById('HTMLElementID')

webObj.base returns the internal DOM

Pawel Krakowiak