Click to See Complete Forum and Search --> : text on the fly?Ok, here is a new question for you guys.


belotte
06-01-2003, 05:58 PM
Ok, here is a new question for you guys.

Is there any way to write a script that would call in text from a text file and posted to the document?

What I would like to do is to be able to change my text on the fly.

If I just had one document that I can enter my text into and it was automatically called into HTML, I think it would be much easier than going through the HTML and formatting it every time I wanted to change the verbage on my page.

Thanks

Rich

brendandonhue
06-01-2003, 06:47 PM
Not from a text file, but you can put in in a JS file and use
<script type="text/javascript" src="file.js"></script>

AdamGundry
06-02-2003, 02:00 AM
The problem with that is if the user has Javascript disabled, they won't get the external code, meaning your page could be broken or unusable. You should use server-side includes or a language such as PHP (which runs on the server) so you can maintain one file but have that included in multiple pages.

Don't make your pages totally Javascript-dependent, because it is disabled by around 13% of users and could be violating disability rights legislation.

Adam