View Full Version : Is it possible to make a text using an external javascript?
kippie
03-09-2003, 05:12 PM
I want to make a fixed text on different HTML's of a site. Is it possible to use an external Javascript for this so that when this text has to be changed it can be done in the external script only instead of in all the different HTML's ?
Can anyone help with this ?
Kippie
COBOLdinosaur
03-09-2003, 05:40 PM
Sure just write the code in the file like this:
var str='';
str+='<div> some stuff here</div>';
str+='<p style="text-align:center"> more stuff</p>';
document.write(str);
Then just save the file with .js extension, and where ever you want it in the pages do:
<script src="yourcode.js"></script>
And it will generate the lines of code
FJbrian
03-10-2003, 07:11 AM
upload a js file to your server
that reads
document.write('whatever text');
then amidst any page just use <Script Language="Javascript" src="whatever.js"></Script>
Common use for "footers" or "headers"
kippie
03-10-2003, 08:51 AM
Thanks
Kippie
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.