Re: How do I get HTML sent to server?
- From: VK <schools_ring@xxxxxxxxx>
- Date: Mon, 16 Jun 2008 10:57:10 -0700 (PDT)
On Jun 16, 8:54 pm, "MC" <mica[removethis]@aisus.com> wrote:
the main html is served
by a single page but the inner content may come from dozens of servers. We
are trying our best to approximate and document the client view.
You cannot do it in principle unless you have client-side installed
scriptable plugin to take screen snapshots and to submit them to the
server. This is the only way to go I guess if there is a legal issue
involved.
The problem is that the browser - any browser - does _not_ have access
to the HTML source used to render the current page. Yes, sounds crazy.
Yes, anyone can click View > Page Source or equivalent to see the
source: anyone can but browser cannot. What browser can "see" is the
DOM Tree resulted from the parsing algorithms and error correction
mechanics of this particular browser applied to the server HTML
source. Respectively by getting document.documentElement.innerHTML
(the whole page) or document.body.innerHTML (body only) you are not
getting the original source. Instead the browser is "reverse
engineering" for you the current DOM Tree into some HTML code which
is, being reused by this particular browser, should result to a copy
of the current DOM Tree which is by itself is a browser-specific
result of parsing the original HTML source. The results may differ
dramatically as you may guess. For a taste of it try for instance this
code in different browsers:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
</head>
<p>Hello!
</html>
<script>
window.onload = function() {
window.alert(document.documentElement.innerHTML);
}
</script>
So it is a dead end where you are working with now. Unless you consult
with your legal department and they conclude that server-side provided
HTML source and client-side resulted DOM Tree must be considered as
legally equal entities :-) Actually the question sounds very
California-style. I doubt there are by far precedent cases like "HTML
Source VS. DOM Tree" or "John Doe and Al. VS. Internet Explorer HTML
Parser Document Forgery" and the like but who knows under this hot
sun. :-)
I would still suggest to stop wasting your time for that. Instead buy
yourself a valid code-signing certificate and do either of two:
1) Require extended privileges for your signed script / ActiveX to
make cross-domain calls and to collect the original HTML sources
before rendering them.
2) Better yet make a signed plugin / ActiveX to make screen snapshots
and require to install it for each client.
Both ways are still rather silly in comparison with regular legal
alternatives but at least doable.
.
- Follow-Ups:
- References:
- How do I get HTML sent to server?
- From: MC
- Re: How do I get HTML sent to server?
- From: SAM
- Re: How do I get HTML sent to server?
- From: MC
- Re: How do I get HTML sent to server?
- From: Jonas Raoni
- Re: How do I get HTML sent to server?
- From: MC
- Re: How do I get HTML sent to server?
- From: Evertjan.
- Re: How do I get HTML sent to server?
- From: SAM
- Re: How do I get HTML sent to server?
- From: Evertjan.
- Re: How do I get HTML sent to server?
- From: MC
- Re: How do I get HTML sent to server?
- From: Evertjan.
- Re: How do I get HTML sent to server?
- From: MC
- How do I get HTML sent to server?
- Prev by Date: Re: How do I get HTML sent to server?
- Next by Date: Re: How do I get HTML sent to server?
- Previous by thread: Re: How do I get HTML sent to server?
- Next by thread: Re: How do I get HTML sent to server?
- Index(es):
Relevant Pages
|