Re: How can I set my own text into a browser? - Mozilla

This is a discussion on Re: How can I set my own text into a browser? - Mozilla ; Ok, so I did something like this: document.getElementById('messagepane').contentDocu ment. That extracts my content and I can add tags, since it is HTML. But my problem is after I put my tags, how do I put the new content in the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: How can I set my own text into a browser?

  1. Re: How can I set my own text into a browser?

    Ok, so I did something like this:
    document.getElementById('messagepane').contentDocu ment. That extracts my content and I can add tags, since it is HTML. But my problem is after I put my tags, how do I put the new content in the browser?
    I know for editor, you have smth like rebuildDocumentFromSource(your_text).

    I don't know for browser how this is done.

    Regards,
    Ioana

    Neil wrote: Ioana Giurgiu wrote:

    >Thanks for the extensive answers i got for my last post. Indeed, the browser i was referring to is 'messagepane'. But how can I set my own text into the browser (after I read the mail, I want to take the content and add some font colors to certain parts... and then set the modified text back into the browser).
    >
    >

    You can access its .contentDocument property and then do normal DOM
    manipulation from there on.

    --
    Warning: May contain traces of nuts.
    _______________________________________________
    dev-extensions mailing list
    dev-extensions@lists.mozilla.org
    https://lists.mozilla.org/listinfo/dev-extensions



    ---------------------------------
    Got a little couch potato?
    Check out fun summer activities for kids.

  2. Re: How can I set my own text into a browser?

    Ioana Giurgiu wrote:

    >Ok, so I did something like this:
    >document.getElementById('messagepane').contentDocu ment. That extracts my content and I can add tags, since it is HTML. But my problem is after I put my tags, how do I put the new content in the browser?
    >

    Well, the lazy way is to read and write .contentDocument.body.innerHTML
    otherwise you have to read up on how to use the DOM manipulation
    functions such as .splitText

    --
    Warning: May contain traces of nuts.

+ Reply to Thread