Hello,
Maybe try to replace 2nd console.log() with:
console.log("found elem = " + JSON.stringify(elem));
W dniu piątek, 25 lipca 2014 10:30:03 UTC+2 użytkownik Ben napisał:
>
> I searched inside a GM script for an element of a web page which contains
> some text string pattern.
> If found I want to output it to WebConsole. Therefore I code the following
> in the GM script:
>
> var elem = $("h2:contains('dummy')");
> console.log("before output");
> if (elem) {
> console.log("found elem = " + elem); }
>
> However when I look at the WebConsole then the object content is not
> displayed. Instead it appears the following:
>
> "before output"
> "found elem = [object Object]"
>
>
> How can I display the content of the found elem in human readable format
> (=just as the original html code)?
>
> Thank you
> Ben
>
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.