• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Java Script in external *.js files

New Here ,
Jul 11, 2007 Jul 11, 2007

Copy link to clipboard

Copied

I have some Java Script functions that I need to include in several topics. If I place them in the header section of a HTML file all works fine. But this is cumbersome because I have to copy all the functions to each topic file.
Then I thought I could place the scripts into a separate "MyScripts.js" and include them using
<script src="MyScripts.js" type="text/javascript"></script>
But obviously this is not the way to do it. Nothing goes anymore. I also tried to place the file in the baggage. It does not make any difference whether I include the file in the Header- or Body-sections.
Can anybody tell me how to properly use functions and variables from a script file? Thanks a lot.

Walter

Views

262

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 11, 2007 Jul 11, 2007

Copy link to clipboard

Copied

LATEST
It sounds like you know how to call a function, but need a way to distribute the '<script src="myscripts.js"...' portion of your code.

Currently I do this by adding the javascript file to baggage (you did this) and then inserting the <script src="myscripts.js"...' bits to my topic templates (.HTT files). This works for my projects, though I don't know if it is applicable to yours.

The contents of your external javascript file will need to (likely) look something like:

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp