Adding javascript just before closing body tag

Here should go questions about transforming XML with XSLT and FOP.
kmank
Posts: 108
Joined: Mon Apr 19, 2010 5:33 pm

Adding javascript just before closing body tag

Post by kmank » Tue Nov 24, 2015 11:20 pm

Hi,
Using O17.1, I'm trying to add a script just before the closing body tag of all webhelp topics. Searching the forum, I cannot locate the file in which to place the code.
Any help is greatly appreciated!

bogdan_cercelaru
Posts: 221
Joined: Tue Jul 01, 2014 11:48 am

Re: Adding javascript just before closing body tag

Post by bogdan_cercelaru » Wed Nov 25, 2015 12:47 pm

Hello,

I've logged your request on our issue tracking tool to be analyzed.
Until it is implemented you can use the webhelp.footer.file parameter as a workaround.
The content of the file referred by this parameter should look like:

Code: Select all


<script type="text/javascript">
/* Your code goes here */
</script>


Regards,
Bogdan
Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

kmank
Posts: 108
Joined: Mon Apr 19, 2010 5:33 pm

Re: Adding javascript just before closing body tag

Post by kmank » Wed Nov 25, 2015 7:36 pm

thank you Bogdan - this certainly could be a resolution. However, this morning I located where it needed to be:

dita2webhelp.xsl needed to be modified in <xsl:template match="/|node()|@*" mode="gen-user-footer"> .
Simply placing the javascript code before </xsl:template> allowed the script to appear immediately before the output </body> tag.

This allows for the end result without needing to deliver another file to the authors.

Thanks again for your direction.

Post Reply