This was the standard method before PHP became common.
Please mind that the external file to be included, SSI, PHP or whatever, should only consist of the code that would be in that place as a part of the html. The file with the SSI command must have the shtml extension, but the file to be included could have any extension you like though most people use html so the file can be viewed by its own,
(Please don’t mix up includes with frames/iframes where a complete html file is displayed but not a part of the html that contains the frame only.)
Doing things server side should be more robust, being browser agnostic.
PHP is freely available and offered as standard by most hosts.
It can be used for things as simple as basic includes, but will also offer the ability it include a little logic too, or a whole world of possibilities beyond that as the site grows and your needs become more complex.
Thanks. I believe I would not be able to test this approach locally? Do you think there’s something more modern that I could use.
Actually, I converted all PHP files recently to HTML and looking for a way to include the external files just like PHP has include function. I would prefer not to go to something which was used before PHP arrived.
Thanks. Actually, I am not planning to use any server side related thing, hence SHTML wouldn’t be a good option for me as well. I believe, I would have to use the jQuery load everytime I have to use external HTML as mentioned in the post below:
Thanks again. Your answer does answers my question. When I say “to include HTML file from somewhere else”, I mean from different directory and not somewhere else from the web. Sorry about the confusion.
That’s where I was thinking of using the jQuery load method as explained in the post I shared above. Thanks