Re: include facility in html

Marty Landman wrote:
> 
> >Jed Hunsaker wrote:
> 
> >It would be very useful to be able to embed HTML just like any WAV or
> MIDI >file. I know it's already available for JavaScript as a js file
> but I still wonder why >not HTML? If I use a footer on every HTML page
> and I want to edit it, I have to >go to each HTML page and edit it one
> by one.  I should be able to just edit one >file called footer.html.
> embed src=footer.html, that simple. I'm sure it couldn't be >all that
> tedious.
> 
> I agree in spirit... the ability to include text w/o actually coding it
> would be great.  As it is now I use SSI with Perl to get that effect on
> my web site.  I'm wondering if in fact there are issues preventing this
> kind of facility up to now.  It seems like such an obvious thing to do I
> wonder if there's a good reason it hasn't been done!
> 
> Unfortunately the alternative is the proliferation of other
> methodologies which just causes headaches for developers IMHO.  That is,
> HTML is the starting point of web content and as such the W3C is in a
> position to affect the cleanliness of implementation to a  greater
> extent on the part of user agents than anyone/thing else, again IMHO.
> 
> So why isn't there a tag for including text in html code?
> 
> --
> Marty Landman     ICQ#5999387       http://www.catnmoose.com
> 
> --- use Cat 'n Moose's Web Safe Color Analyzer ---
>   >>    http://www.catnmoose.com/wsc.shtml    <<


There is the option of "Javascript includes"

Basically you create a .js file which contains all of the repeatitive
content
in separate variables. Then you document.write it to the user.

i.e.

	<html>
	<head>
	.
	.
	.
	<script src="redundant.js" language="Javascript">
	<!--
	//-->
	</script>
	</head>
	<body>
	.
	.
	.
	<script language="Javascript">
	<!--
		document.write(txt);
	//-->
	</script>
	.
	.
	.
	</body>
	</html>


Then the redundant.js would contain:

	txt = "<h1>Hello World</h1>";
	txt += "<p>My name is <b><i>Rob</i></b>";

Unfortunately older browsers (2.0 and lower) will not show the HTML
since
they do not support external Javascript. Search engines will not pick
this
up either. What can be done is only encapsulate layout elements in the
javascript source files. That way your content is still visible to
Netscape 2.0,
etc. users as well as the search engines.


For more information, please feel free to contact me,

Rob

Received on Monday, 31 August 1998 05:18:43 UTC