[ic] linking to external javascript file from IC template?

Ryan Hertz interchange-users@interchange.redhat.com
Tue Apr 16 13:58:01 2002


At 09:18 AM 4/16/02 -0400, Aaron Hazelton wrote:
> > Hi everybody,
> > I have used a js dropdown menu in the past, but the only way
> > I could get it to work, was to actually insert all of the
> > javascript between the <script> tags.  Im working on another
> > menu on which that wont be so easy.  Can you in fact link to
> > an external .js file from a template? Or is this just not
> > possible with IC?  Thanks!
> >

You can do it via IC's include:
[include file="/path/to/yourjavascript.js"]

Or you could do it the HTML/JS way:
<script src="/path/to/yourjavascript.js"></script>

Using the IC include method will allow you to embed IC markup in the 
javascript.   The script source method may be more efficient for "static" 
code in that some browsers may cache the script.   Or you could even have 
the <script> source tag inside an [include]d HTML file to perhaps reap the 
best of both worlds.

-r