You could add a script (or CSS) to the doc head using the HTML Helper
['version' => 'auto', 'relative' => false]
However, you cannot add PHP code to Joomla articles so you have to use another method for that. For instance a plugin that adds it to the code for ...
I can solve it. JCH Optimize solved the problem almost.
You can add Js what you want to remove if unused.
you should do:
Downloads plugin JCH Optimize. I use free version
get in setting plugin
save and clear chache
I was wrong before. It works only if you have script on you server or ...