|
Posted by Harlan Messinger on January 6, 2009, 4:00 pm
Please log in for more thread options twiggy182 wrote:
> wrote:
>> twiggy182 wrote:
>>> Hi,
>>> for some reasons, with the "Web Developper bar" in Firefox, I
>>> discovered that there are differences between the "Source code" and
>>> the "Generated source code" in my application.
>>> The main difference is that all my "</option>" tags are missing in the
>>> "Source code". Because of that, the "<optgroup>" tag isn't recognized
>>> at all in IE ( "</option>" tags are also missing in IE when I view the
>>> source code ).
>>> Source code:
>>> <select>
>>> <optgroup label="My group">
>>> <option value="1">A
>>> <option value="2">B
>>> <option value="3">C
>>> <option value="4">D
>>> </optgroup>
>>> </select>
>>> Generated source code:
>>> <select>
>>> <optgroup label="My group">
>>> <option value="1">A</option>
>>> <option value="2">B</option>
>>> <option value="3">C</option>
>>> <option value="4">D</option>
>>> </optgroup>
>>> </select>
>>> So can someone tell me why both FF and IE remove these closing tab?
>> I don't understand. You are showing that the browser is *adding* the
>> closing tags. The "source code" is the code received by the browser. The
>> "generated source code" is what the browser spits out when it recreates
>> a well-formed HTML document from its in-memory DOM tree (that is, its
>> internal representation of the document).
>>
>>> Another strange thing I noticed: I copied the "Generated source code"
>>> and put it in a new file, and if I open the file in FF or IE,
>>> everything is working well. So I don't understand when this kind of
>>> filtering is applied. Anyone know?
>> What do you mean by "filtering"? Naturally the page looks the same.
>> You're feeding the browser exactly the same code that it considered to
>> be equivalent to the DOM tree it built the first time around.
>
> Hi Harlan,
>
> by "Source Code" and "Generated Source Code" I refer to the terms used
> by "Web Developper" bar in FF. Just to clarify a little bit:
> Source code: The code used to display the page
> Generated source code: The code generated by the application, which is
> what the browser receives as input
Nope. "Source code" is what is received from the server, "generated
source code" is what Firefox spits back out after processing. If the
"generated source code" was what the browser received, what would be
"generated" about it?
Example: create a web page containing:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<title>Generated source test</title>
<p>Try this.
Load it in Firefox. "View source" will give you the above. "View
generated source" will give you:
<html><head>
<title>Generated source test</title>
</head><body><p>Try this.
</p></body></html>
where Firefox will have created the required html, head, and body
elements in its internal model, and when you ask it to generate source
code, will display the tags for them, as well as the closing </p> tag.
> So the browser is in fact *removing* the closing tags in a given
> filtering process.
Nope.
|