Hello,
i already searched in the forum but can't find a similiar thread.
I placed my javascript code in the template file under my html code and sourrounded it with: [% WRAPPER JSOnDocumentComplete %] ... [% END %]
My problem is that javascript gets executed three times and when I look in the source code in the browser, the javascript code can be found on three different areas. This explains why it gets executed three times, but why does this happen at all? How can I call it once?
Thanks
Addon Javascript executed three times
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Addon Javascript executed three times
Hi there,
this might depend on the template. I think OTRS renders each article in a separated iframe. There are some solutions for it:
- Use the LayoutObject in the Perl Module to add the code once
- Use a Post-Filter to modify the "finished" HTML
- Use a variable to make sure to execute the code only once...
this might depend on the template. I think OTRS renders each article in a separated iframe. There are some solutions for it:
- Use the LayoutObject in the Perl Module to add the code once
- Use a Post-Filter to modify the "finished" HTML
- Use a variable to make sure to execute the code only once...
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS