A JavaScript that works standalone in an HTML file before it
is compiled in a WebHelp project, no longer works after the WebHelp
project is compiled. I don't see anything about JavaScript in the
Help for RoboHelp HTML 7. The JavaScript was imported into the
project automatically since it is referenced in the HTML file. The
script just toggles a paragraph to collapse or expand, and upon
expansion there is a different icon image that is displayed.
After the HTML file is compiled, and you click the paragraph
icon to expand the paragraph, the expanded icon is not displayed.
You probably need to add the image to your Baggage files
folder of RoboHelp. If you aren't using it in any topic, RoboHelp
is probably blissfully unaware of it.
You would also want to do the same thing with any .JS file(s)
you added.
You might also want to verify that you have placed the JS
calls and links in the correct locations. Some JS solutions need
the call inside the HEAD section, some recommend directly after the
opening body tag or directly before the closing body tag. This can
be crucial if you also have popup links, expanded text, etc. in the
same topic.
/t5/robohelp-discussions/robohelp-seems-to-break-javascript-in-html-file-placed-in-webhelp-project/m-p/991832#M42249May 01, 2008
May 01, 2008
Copy link to clipboard
Copied
LATEST
Peter,
What I've done in RHx7 HTML is copy and paste the entire
script into the Script dialogue box (Insert > HTML > Advanced
> Script) and placing it directly under the Source tag. This
works fine for me, even though it is not space-economical (having
the script in every file rather than referencing it).
The script then appears in RH as a RED BOX. You may have to
tweak the location of it to get it to work exactly as you want.
To save time (but not space), I just added the script to the
templates where needed. Others more savvy than me can probably tell
you a fool-proof way of calling out the scripts vice embedding
them. I'm even using internal frameset scripts that point to
external URL's (a poor man's RSS feed).