While working on a html template, I wanted to include some global files like the header and footer to avoid duplicating the same code in all the files. But I wondered if there was a way to do this without having to resort to PHP . Although it’s a popular language, some buyers might want to use the files with ASP , Rails, or another server-side language.
It turns out it’s very easy to do with jQuery, so I wrote up a very short tutorial:
Disclaimer: don’t use this technique if you think your buyers are going to use the files as they are, because if they use a client-side include on their live site, Google won’t be able to index it. But it’s still a useful trick for something like an admin interface template.
This is one way, but I’m pretty sure you can just use AJAX to include the file in the same way.
Using AJAX to include the file is already what I’m doing… I’m not sure what you mean?