ckishappy wrote:It works somehow but it feels clumsy. Any advise?
I would say, if it's not broken, don't try to fix it.
X3 is an AJAX application, which loads partial page content for a faster and smoother experience. Because of this, it can be complicated to work with 3rd party scripts, and the simple solution is often to add the scripts to content like you have done ... if it works, then there is really nothing wrong with that. There are hooks in X3, for example
x3_load_page(){ ... }, which can be used in custom javascript settings section to trigger specific custom functions, for specific pages, but this often requires an understanding of the 3rd party javascript and how to trigger/initiate it. It would also allow you to for example add the script SRC to <head>, instead of injecting directly into the content ... More aesthetic, and for some plugins, it is necessary, but not always worth the hassle if it already works.