Thanks a lot. The author clearly mentioned in his post that it's
'Chrome' code, but being a newbie I didn't understand what 'Chrome'
meant in this context.

Also, can I use 'getElementsByClassName' on a loaded DOM.

I mean I load the retrieved html into a div taking care to remove the
scripts part of it. I have used mostly classes instead of IDs, but
getElementsByClassName returns 'undefined' to the Firebug console. Why
does that happen? BTW, I'm using the latest updated versions of GM and
FF 3.6

On Mar 25, 4:23 pm, Fracture <[email protected]> wrote:
> That example uses Chrome code (Components.classes,
> Components.interfaces, getService()), intended for use by an
> Extension.  Greasemonkey does not have access to these objects or
> methods.  It is essentially at the same level as whatever javascript
> is being run on the page.
>
> Instead, you can just create a div and set its innerHTML to the HTML
> in question, but you'll lose the security of UnescapeHTML.  You can
> also try the iframe method.
>
> On Mar 25, 5:07 am, Sid <[email protected]> wrote:
>
> > Hi,
>
> > Whatever function I put in my GM script, cannot be called.
>
> > For example, I'm extracting the html from one of my own site pages
> > through an xmlhttprequest.
>
> > Then I call HTMLParser() with the retrieved text as argument.
>
> > (which can be found 
> > herehttps://developer.mozilla.org/en/Code_snippets/HTML_to_DOM#Safely_par...
> > )
>
> > But it simply fails to return anything.
>
> > Any ideas?
>
> > Thanks
> > Sid

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to