Click to See Complete Forum and Search --> : Javascript and text files


IxxI
05-03-2003, 08:18 AM
I have a rather large javascript for a search function, and this gets changed relatively often. However, onlyt one section of it changes, and so I was wondering if one section of a javascript can be called from a text file, so that I can update the text file without having to wade through the script to get to the right place.
Hope that makes sense - thanks,

IxxI

AdamGundry
05-03-2003, 08:50 AM
You could do something like this:

<script type="text/javascript">
// Code before changing section.
</script>
<script type="text/javascript" src="change.js"></script>
<script type="text/javascript">
// Code after changing section.
</script>

Adam

IxxI
05-05-2003, 05:19 PM
I suppose I really should have thought of that - I was going to modify it using ActiveX Commands and got so hung up on the text thing that I overlooked the obvious - cheers Adam...

IxxI