Skip to main content
May 23, 2008
Question

JavaScript - Inserting globally

  • May 23, 2008
  • 3 replies
  • 377 views
Hi Everyone,
I am using RH6 and outputting FlashHelp.
Is there a way to insert a javascript into ALL of your topics? Or is it only possible to insert a script into one topic at a time?
Also, The script I need to insert has two parts...one part has to go into the HEAD tag and the other part has to go into the BODY tag.
Why am I asking? Because we are going to start using a web analytics product to analyze hit counts in the Help. We did not buy RoboServer and don't want to. (Our web servers are Apache and RoboServer doesn't run on that.)
Anyhow, the web analytics product that we are using requires me to insert a javascript into each HTML file.
Thanks all,
Joe
    This topic has been closed for replies.

    3 replies

    Participating Frequently
    May 23, 2008
    Hi, Joe,

    You should be able to store your scripts in one or more external JavaScript (.js) files, which you then reference in the Head or Body section of your topics. See this page for more information:

    http://www.w3schools.com/js/js_whereto.asp

    Pete
    RoboColum_n_
    Legend
    May 23, 2008
    Just a further thought, add the javascript to template and then all new topics should automatically contain it. I haven't tested this but it would save having to repeat the process for future releases.
    RoboColum_n_
    Legend
    May 23, 2008
    Hi Joe.

    You can only add a javascript to one topic at a time inside RH but if you use a find and replace tool you can do it across multiple files. FAR and BkReplacem are two popular ones. Just Google them.