|
Posted by twiggy182 on January 6, 2009, 10:47 am
Please log in for more thread options
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.
show/hide quoted text
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:
show/hide quoted text
<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:
show/hide quoted text
<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?
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?
So thanks in advance for any help you could give me.
|
|
Posted by Harlan Messinger on January 6, 2009, 11:21 am
Please log in for more thread options
twiggy182 wrote:
show/hide quoted text
> 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:
> <option value="1">A
> <option value="2">B
> <option value="3">C
> <option value="4">D
>
> Generated source code:
>
> 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).
show/hide quoted text
> 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.
|
|
Posted by twiggy182 on January 6, 2009, 11:40 am
Please log in for more thread options wrote:
show/hide quoted text
> 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:
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"1">A
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"2">B
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"3">C
> > =A0 =A0 =A0 =A0 =A0 =A0<option value=3D"4">D
> > Generated source code:
> > 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
So the browser is in fact *removing* the closing tags in a given
filtering process.
Also, to rephrase the second part of initial post, the browser doesn't
process the code the same way when my application sends it the code
(generated dynamically) compare to when I open the same code in a
static html file.
Thanks
|
|
Posted by Harlan Messinger on January 6, 2009, 4:00 pm
Please log in for more thread options twiggy182 wrote:
show/hide quoted text
> 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:
>>> <option value="1">A
>>> <option value="2">B
>>> <option value="3">C
>>> <option value="4">D
>>> Generated source code:
>>> 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"
show/hide quoted text
"http://www.w3.org/TR/html4/strict.dtd">
show/hide quoted text
<p>Try this.
Load it in Firefox. "View source" will give you the above. "View
generated source" will give you:
show/hide quoted text
<html><head>
show/hide quoted text
</head><body><p>Try this.
show/hide quoted text
</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
show/hide quoted text
code, will display the tags for them, as well as the closing </p> tag.
show/hide quoted text
> So the browser is in fact *removing* the closing tags in a given
> filtering process.
Nope.
|
|
Posted by Jukka K. Korpela on January 6, 2009, 4:06 pm
Please log in for more thread options Harlan Messinger wrote:
[a lengthy quotation, always a useful warning signal, and then...]
show/hide quoted text
> Example: create a web page containing:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> <p>Try this.
> Load it in Firefox. "View source" will give you the above.
Indeed. No surprise.
show/hide quoted text
> "View
> generated source" will give you:
> </head><body><p>Try this.
> where Firefox will have created the required html, head, and body
> elements in its internal model,
That's mildly surprising, since what I intuitively expected "generated
source" to contain is markup generated by execution of client-side
scripting. And I think this is the most relevant and most useful feature of
this function.
What's wrong in your statement is the word "required". The end tags are
definitively optional by HTML 4.01 rules. You may have meant that they are
"required" by the "internal model" of Firefox, but you did not say that at
all and I don't think it's even true. There is no reason why explicit end
tags would be "required" for an internal model, which is really a tree
structure and has no tags whatsoever.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
|
| Similar Threads | Posted | | What's all that stuff in the source code? | August 25, 2004, 9:04 pm |
| better/easy way to displaying c source code in html | July 18, 2006, 5:44 am |
| Code added to my XHTML source files giving problems | November 18, 2005, 6:56 pm |
| Style tags -- Eeek how obese these tags make HTML! | November 8, 2006, 3:33 am |
| Meta Tags, Link Tags, other | September 27, 2005, 3:29 pm |
| Cant view source | September 10, 2004, 12:06 pm |
| Source CANNOT be viewed | December 3, 2009, 9:18 am |
| Simple Open Source CMS | January 23, 2006, 9:00 am |
| looking for open source forums..... | September 8, 2006, 5:48 pm |
| Web Standards Meets Open Source? | September 29, 2004, 11:57 pm |
|
"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