Folks
Here's a skeleton, generic HTML page, call it "index.php" . You'll see a bit
of php code in the middle:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
...
</head>
<body>
....
<?php require("anothe r_page.html"); ?>
...
</body>
</html>
If the contents of "another_page.h tml" is valid, it contains, at the outer
level, <html .... </html>. That means, when the page is served up, the
recipient browser will see something like this:
<html>
....
<html>
...
</html>
...
<html>
That is, completely nested -- though otherwise completely valid-- HTML
files. I've read that doing this is a BAD IDEA, but I can't find out why.
Sure, the HTML spec doesn't say you can do this, but I can't find any place
it says you can't.
OK, common sense says you shouldn't risk doing unusual things to browsers.
Yes, definitely.
Well, I've been nesting files like this for months, and I haven't noticed
anything going wrong on the client. But I'm looking a very narrow test
base: only FireFox on MacOS 10.4.x.
Question 1: Is nesting like this really a BAD IDEA?
You might guess that I have a deeper question. Yup! I've designed a site
that has a single template page, index.php, which dynamically fills in
content using php "require". I put individual chunks of content from .html
files, all of which are stand-alone valid -- starting with <htmland ending
with </html>. Bingo! Nested files.
Why do I make all the .html files stand-alone valid? Because Dreamweaver
(CS3) insists. I can't get functioning WYSIWYG, nor I can use site-wide
CSS otherwise. I need all that working to make the chunks right.
Question 2: Doesn't this issue come up all the time in DHTML site designs?
Question 3: Am I missing something incredibly obvious --or subtle and
magic-- that will fix this and/or teach me to relax about it?
TIA
Henry
remove 'zzz'
Here's a skeleton, generic HTML page, call it "index.php" . You'll see a bit
of php code in the middle:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
...
</head>
<body>
....
<?php require("anothe r_page.html"); ?>
...
</body>
</html>
If the contents of "another_page.h tml" is valid, it contains, at the outer
level, <html .... </html>. That means, when the page is served up, the
recipient browser will see something like this:
<html>
....
<html>
...
</html>
...
<html>
That is, completely nested -- though otherwise completely valid-- HTML
files. I've read that doing this is a BAD IDEA, but I can't find out why.
Sure, the HTML spec doesn't say you can do this, but I can't find any place
it says you can't.
OK, common sense says you shouldn't risk doing unusual things to browsers.
Yes, definitely.
Well, I've been nesting files like this for months, and I haven't noticed
anything going wrong on the client. But I'm looking a very narrow test
base: only FireFox on MacOS 10.4.x.
Question 1: Is nesting like this really a BAD IDEA?
You might guess that I have a deeper question. Yup! I've designed a site
that has a single template page, index.php, which dynamically fills in
content using php "require". I put individual chunks of content from .html
files, all of which are stand-alone valid -- starting with <htmland ending
with </html>. Bingo! Nested files.
Why do I make all the .html files stand-alone valid? Because Dreamweaver
(CS3) insists. I can't get functioning WYSIWYG, nor I can use site-wide
CSS otherwise. I need all that working to make the chunks right.
Question 2: Doesn't this issue come up all the time in DHTML site designs?
Question 3: Am I missing something incredibly obvious --or subtle and
magic-- that will fix this and/or teach me to relax about it?
TIA
Henry
remove 'zzz'
Comment