I’m doing a site for a client who needs to update a very small amount of text (and a link) on a regular basis.
The text and link need to be on every page, so to facilitate this I’ve got a JavaScript file that’s called by each HTML file. Thing is, I want to make it really easy for him to update, so rather than have him tinkering around inside the .js file, I’d rather use a simple .txt (or .js) file that he can just enter the link and text into. I don’t know of any way in JS to call in another file.
Anyone got any ideas? I can’t use Perl or ASP or CFM or anything like that - it’s HTML and JS only.
Yes, it works. But this creates a user dependency. Anyone visiting the web site with JavaScript turned off will not see the content you are attempting to display.
Go the SSI route. It’s the better option. It’s professional. It’s the correct way to go.
What technology are you using? Server side is definitely the way you want to go. If you’re using something that supports ASP or JSP, you could make a simple file that is parsed and loaded into application variables. Then just include them on each page.