the possibility of viewing unrendered source?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

the possibility of viewing unrendered source?

jeff lee-3
    hi everyone, it's my first post here.
    I'm developing a information extraction tool which extracts rules from
multiple html pages. I want to make the tool automatically locate the
source code segment by the mouse position in browser. I can get the
element by elementFromPoint method but the outerHTML of this element
is rendered... i.e., it's not the original code in the html page:

<table class=ejoetable1 height="85" border="0" align="center"
cellpadding="0" cellspacing="0">
may become
<table class="ejoetable1" align="center" border="0" cellpadding="0"
cellspacing="0" height="85">

So is there any way to get the original(unrendered) source of some
element? I googled but found someone said firefox doesn't even keep
the source code of an html in memory... then is it impossible to do
so?
Thanks.

                                                                     
          Jeffrey Li

_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom
Reply | Threaded
Open this post in threaded view
|

Re: the possibility of viewing unrendered source?

Boris Zbarsky
jeff lee wrote:
> So is there any way to get the original(unrendered) source of some
> element?

Said source may not even exist (what with innerHTML, document.write,
document.createElement(), etc, etc).

> I googled but found someone said firefox doesn't even keep
> the source code of an html in memory...

That's correct.  And even if it did, that source may have little relationship to
what's currently being rendered.

-Boris
_______________________________________________
mozilla-dom mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-dom