How to properly upload a js library on Forms Application

Hello
I’m trying to understand how to load, properly, a js lib, that helps me to calculate the fiscal code on change (every time the user insert input fields , the code check if can create/recreate fiscal code).
I followed this tutorial. It’s explanatory, i created my external lib and, (i don’t have OnExecute events on forms), i tryed to load it through OnApplicationInit, doesn’t work properly.
Every time i try to save my record, a modal appears that says : The operation can be completed, if you want to save this record before completion you loose your file. If i do any other operation before saving, that message doesn’t appear.
So i suppose that loading libs on this event (OnApplicationInit) isn’t correct. But if i try to upload in other events (OnScriptInit, OnLoad) it’s worse.
So my question is : where usually and technically do i have to load my external js lib if i don’t have a index?
Thx in advance.