Yes, the script will not work in preview.construct.net, just when uploaded to our servers.
I've solved (for a moment) the problem with your trick; JQuery plugin for Construct 3. In this way I can import my script from Construct 2. For a moment it's ok. I will try to remake it using your idea in the future.
Thank you all! :)