html in Includes

liunx

Guest
Hi everyone! ...<br />
<br />
I've just been told that I am mis-using an Include (ServerSideInclude) and I would like to hear from others if I actually am or not (i probably am... i am such a hack :rolleyes: ).<br />
<br />
ok... so I have a page (it's an ASP page to be exact)...<br />
and it basically looks something like this:<br />
<br />
<br />
<html><br />
<head></head><br />
<body><br />
<br />
<table><br />
<tr><br />
<td>blah</td><br />
</tr><br />
<tr><br />
<td><!-- #include file="myTable.inc" --></td><br />
</tr><br />
<tr><br />
<td>blah</td><br />
</tr><br />
</table><br />
<br />
</body><br />
</html> <br />
<br />
and then the Include (myTable.inc) looks like this:<br />
<br />
<table><br />
<tr><br />
<td>blah</td><br />
</tr><br />
<tr><br />
<td>blah</td><br />
</tr><br />
<tr><br />
<td>blah</td><br />
</tr><br />
</table><br />
<br />
I use this to... (get ready... :eek: ) ...to nest a table :eek: !!! <br />
... but it works fine (tested on IE 5.0, 5.5, 6.0, N7, Opera6.02)<br />
<br />
Is that allowed?<br />
And if not... could I get away with it by encapsulating it as asp inside respose.write lines?<br />
<br />
This particular Include (table data) is used across many. many pages...<br />
and it's just so much easier to update the content within the Include table than to update each page (and <iframe> is not an option... so we don't need to go there :rolleyes: ).<br />
<br />
So... mis-use?<br />
Any suggestions?<br />
We have such a cross-section of experts/opinions here in this forum... I'm curious to hear the responses :) <br />
<br />
hacking away the moments that make up a dull day...<br />
;) k<!--content-->There shouldn't be a space before the #, but that may have just been caused by the forum. Otherwise, there's nothing wrong with it. How exactly were you told you were misusing it?but it works fine (tested on IE 5.0, 5.5, 6.0, N7, Opera6.02)SSI is parsed at the server, so if the output is correct in one browser then it is correct for all browsers. That's what makes server side stuff so nice. :)<!--content-->How exactly were you told you were misusing it? I was told that "straight" html was not intended for use within an include.<br />
(of course that same person was the one who couldn't figure-out how the data was getting to the page at all, since he didn't initially see the Include in my code in the first place :rolleyes: ).<br />
<br />
I don't know... I guess I just get paranoid sometimes... since I'm self-taught and tend to come-up with "creative" solutions that are not always "conventional" in their approach (mostly due to my lack on knowledge in conventional approaches. LOL!!!).<br />
<br />
Plus... this guy made a big-stink while I was not there to protect myself... so I was already on the defensive before I had a chance to know what was really going-on (office politics... i guess :rolleyes: )<br />
<br />
okay... I want us both to be right, so I'm gonna go ahead and defend it at the Monday meeting. <br />
Thanks Jeff :)<br />
<br />
;) k<!--content-->There is nothing wrong with that setup.If you are dynamically creating some html as long as its legal html there is nothing wrong.The person objected on it probably just wanted to pick on your code tats all,may be somebody who is your senior but doesn't know as much as you do.<br />
<br />
:D<!--content-->I was told that "straight" html was not intended for use within an includeI suppose this other person would prefer crooked HTML? :p<br />
<br />
Includes are often used for headers/footers to create a standard look across all pages. But more generally, they are used when the same code is used across many pages, which is exactly what you're doing. So your usage of includes is exactly what they were intended for.<!--content-->hey...<br />
thanks guys!!! :)<br />
<br />
i usually trust my instincts (and then crash-and-burn when they turn-out wrong :rolleyes: )...<br />
<br />
V--E--R--Y appeciative as always...<br />
;) k<!--content-->
 
Back
Top