For those who are curious, and to punish those who don't care, :) I will recap what I decided to do about my problem:
Basically, there IS NO GOOD WAY to do client-side includes in HTML (at least not until HTML 4.0 comes out or the mainstream browsers are upgraded to include some of the features that have been in place since the mid '80s.) So the only semi-universal way seems to be Javascript. I didn't want to do anything with PHP on the client or SSI because the code that I am going to give people to paste into their web pages has to run on ANY server, from AOL to Tripod to any one of the miriad of free or cheap hosting companies out there. I also wanted to abstain from frames, as most of the people "programming" these web pages don't have a clue about frames anyway. (Bill E. I'm not talking about you.) :) So we're pretty much stuck with Javascript. The easiest thing to use is the document.write function, which is a pain because the code you generate can't have any line feeds or Javascript "special characters" in it. The NEAT thing I learned is that the file you include in your client code doesn't HAVE to have a .js extension. If you make it a .php file, the server (MY server) will process the php code, and feed the requested file to the client as plain HTML. So the results go like this: Client's web page: <script name=javascript src="http://www.mydomain.com/remote_script.php"></script> The remote_script file looks like this: document.write('<?php {code that reads my php-generated page, cleans out all the newlines, and escapes the javascript special characters} ?>'); What I get AT THE CLIENT for inclusion in the page is this: document.write('<tag>very human-unfriendly HTML code but who cares?></tag>'); which gets inserted nicely inline in the client's web page. That's it. Now that I've explained all this, it should release me from the obligation of giving a talk on the subject, right? Rich Cloutier President, C*O SYSTEM SUPPORT SERVICES www.sysupport.com ----- Original Message ----- From: "Rich C" <[EMAIL PROTECTED]> To: "GNHLUG" <[EMAIL PROTECTED]> Sent: Monday, May 06, 2002 4:49 PM Subject: OT: Client Side Includes for HTML > I have been searching the web for two days looking for an easy way to do > this. > > I don't want to use SSI. > I don't want to use frames in the target web page; I would like to have > the included code appear inline. > I don't want to wait for HTML 4.0- or XML-compliant browsers to > implement entities. > > Javascript document.write() is a kludge because the string cannot have > any line breaks. > > The solution must be fully portable (at least as fully portable as > Javascript is), that is, the code must be able to reside on ANY server. > > At this point I'm on the verge of writing a PHP parser to "clean up" any > documents I wish to include, so the document.write() function doesn't > barf. > > Any other ideas? > > Rich Cloutier > President, C*O > SYSTEM SUPPORT SERVICES > www.sysupport.com > > > > ***************************************************************** > To unsubscribe from this list, send mail to [EMAIL PROTECTED] > with the text 'unsubscribe gnhlug' in the message body. > ***************************************************************** > ***************************************************************** To unsubscribe from this list, send mail to [EMAIL PROTECTED] with the text 'unsubscribe gnhlug' in the message body. *****************************************************************
