Leaner Html code

S

Steve Easton

Yes, optimize is available in FP 2003, but it's not something you really want to use
because it causes problems, and to be perfectly honest I fail to see the benefit of using
it.

The fastest loading web page ( not counting graphics ) is one that:
Has a correct doctype
Has a valid external style sheet.
Validates.

An incorrect or missing doctype forces a browser into "quirks mode" which basically
means the entire page has to be downloaded and available to the browser before the browser
can determine how to "try" render it.

A style sheet doesn't speed up the first page downloaded from a site, but it speeds up all
subsequent pages that use it because it's already in the browser cache files and doesn't
need to be downloaded again.

Valid html speeds up rendering the page in the browser, because the browser doesn't have
to compensate for errors / wait for then entire page to be downloaded before determining
how to render it.

The thing to keep in mind is that a computer / browser sees a web page as one continuous
stream ( string ) of data.
Starting with the doctype and ending with </html>

FP and other editing tools display it in neatly formatted lines of code and paragraphs,
just so we humans can make sense of it.

--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
T

Tom Miller

Like most people I am in favor of "leaner html code/faster loading html
code" as long as I don't have to edit/write it myself. I understand that
using an external CSS sheet will reduce the amout of html code that FP has
to generate compared to doing it in straight html.

Is there a VBA or similar add-in that will try to cleanup/make leaner the
code generated by FP2002? Perhaps something like "tidyup" only tightly
integrated?

I just read a post here that talked about "disabling optimize html code"
during publishing. I have a feeling that is someting available in FP2003?

Thanks,
Tom
 
M

Murray

Good suggestions, all, with one minor change....
An incorrect or missing doctype forces a browser into "quirks mode" which
basically
means the entire page has to be downloaded and available to the browser
before the browser
can determine how to "try" render it.

This is not the case. The page will render as it is parsed by the browser
UNLESS it contains nested tables with col-/rowspans, which mean that the
entire table must be considered before it can begin rendering it.

--
Murray
--------------
MVP FrontPage


Steve Easton said:
Yes, optimize is available in FP 2003, but it's not something you really
want to use because it causes problems, and to be perfectly honest I fail
to see the benefit of using it.

The fastest loading web page ( not counting graphics ) is one that:
Has a correct doctype
Has a valid external style sheet.
Validates.

An incorrect or missing doctype forces a browser into "quirks mode" which
basically
means the entire page has to be downloaded and available to the browser
before the browser
can determine how to "try" render it.

A style sheet doesn't speed up the first page downloaded from a site, but
it speeds up all subsequent pages that use it because it's already in the
browser cache files and doesn't need to be downloaded again.

Valid html speeds up rendering the page in the browser, because the
browser doesn't have to compensate for errors / wait for then entire page
to be downloaded before determining how to render it.

The thing to keep in mind is that a computer / browser sees a web page as
one continuous stream ( string ) of data.
Starting with the doctype and ending with </html>

FP and other editing tools display it in neatly formatted lines of code
and paragraphs, just so we humans can make sense of it.

--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
G

Guest

For those of us who have not taken Murray's excellent advice and actually
learned the code, can you 1) define where the doctype is located in the HTML
and what valid type are and 2) how do you confirm your HTML is "valid".

Steve "trying to change the tire, while the car is rolling"

Murray said:
Good suggestions, all, with one minor change....
An incorrect or missing doctype forces a browser into "quirks mode" which
basically
means the entire page has to be downloaded and available to the browser
before the browser
can determine how to "try" render it.

This is not the case. The page will render as it is parsed by the browser
UNLESS it contains nested tables with col-/rowspans, which mean that the
entire table must be considered before it can begin rendering it.
 
M

Murray

The doctype is the very first thing on the page's code, e.g.,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
.....

what valid type are

HTML4.01 Strict | Transitional
XHTML 1.0 Strict | Transitional
XHTML 1.1 Strict

(right now, there is no reason to use the XHTML1.1 doctype since it is kinda
'out there')

You should choose a doctype that is consistent with your ability to code.
If you are just learning HTML, then stick with HTML 4.01 Transitional (also
called "Loose")

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

This doctype allows you to use HTML syntax rules, and all deprecated tags,
how do you confirm your HTML is "valid".

Ask the oracle at http://validator.w3.org! 8)
 
G

Guest

....and it would appear on first examination that FP does not generate this
because new page or new web in FP 2002 starts the page with <html>.

Should it be on every page?
 
T

Thomas A. Rowe

You have to add it to the page, as you must determine the correct DOCTYPE to use.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
G

Guest

Interesting, thanks for the information. I checked one page and most of the
errors were things like "leftmargin" "topmargin" which looks like they should
be corrected with CSS.
 
T

Thomas A. Rowe

You will see this when you insert a VML Graphic, such as a text box, WordArt, etc.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
T

Thomas A. Rowe

You may have to manually remove those tags.

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================
 
T

Tom Miller

The doctype is the very first thing on the page's code, e.g.,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
....



HTML4.01 Strict | Transitional
XHTML 1.0 Strict | Transitional
XHTML 1.1 Strict

(right now, there is no reason to use the XHTML1.1 doctype since it is
kinda 'out there')

You should choose a doctype that is consistent with your ability to code.
If you are just learning HTML, then stick with HTML 4.01 Transitional
(also called "Loose")

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

This doctype allows you to use HTML syntax rules, and all deprecated tags,


Ask the oracle at http://validator.w3.org! 8)

Murray,
Is there a way to add this to the basic FP (2002) template so that when you
create/open a new page this code is present?

Ditto, on the Tools->Page Options->Compatibility tab.

Thanks,
Tom
 
T

Tom Miller

Murray,
Is there a way to add this to the basic FP (2002) template so that when
you create/open a new page this code is present?

Ditto, on the Tools->Page Options->Compatibility tab.

Thanks,
Tom

Just found:
http://msdn2.microsoft.com/en-us/library/aa218654(office.11).aspx

Which points you to 3 ways to add it including one case where you can add it
to "normal.hm" The problem is, that only works on a sub-set of the new
pages. Wizards (of course) don't use the normal.htm and apparently neither
does the command for creating a 1 page website.

Darn.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top