Browser Widget and external JavaScript files
Posted: Thu Apr 12, 2018 1:29 am
Hi Livecode community,
This is my first post. So please forgive me if my question should belong to another thread.
I am new to Livecode, coming from JavaScript, AS3 etc. I did some experiments with the browser widget. I successfully managed the 2-directional communication (LC to JS and JS to LC). What i try to achieve: building a LC-Standalone Application capable of "cleaning up" SVG-files located in local html files. This works fine already.
The next step would be to set animation params and play the SVG-animation within the browser widget. This doesnt work well.
Here is my problem:
The final animation is done in JavaScript (own script, no jQuery).
To keep the HTML/JavaScript clean, the JavaScript files are kept separated (external files)
When tested purely in a "normal" Browser, animations work as aspected. So: the JavaScript is fine.
But: when loaded into the browser widget, animations wont play.
Testing:
This also happens, when using JS frameworks. In this case: Snap.js
More testing:
Instead of using an external JavaScript file, i copied that into the main html file. Bingo: now this works also in the browser widget !?
So my question is:
- Does the "liveCode"-Object (LCs extension to the browser) interferes with external .js files ?
- Is this a known issue?
- work arounds?
- btw. i am using the community edition
Thanks in advance, Folko
This is my first post. So please forgive me if my question should belong to another thread.
I am new to Livecode, coming from JavaScript, AS3 etc. I did some experiments with the browser widget. I successfully managed the 2-directional communication (LC to JS and JS to LC). What i try to achieve: building a LC-Standalone Application capable of "cleaning up" SVG-files located in local html files. This works fine already.
The next step would be to set animation params and play the SVG-animation within the browser widget. This doesnt work well.
Here is my problem:
The final animation is done in JavaScript (own script, no jQuery).
To keep the HTML/JavaScript clean, the JavaScript files are kept separated (external files)
When tested purely in a "normal" Browser, animations work as aspected. So: the JavaScript is fine.
But: when loaded into the browser widget, animations wont play.
Testing:
This also happens, when using JS frameworks. In this case: Snap.js
More testing:
Instead of using an external JavaScript file, i copied that into the main html file. Bingo: now this works also in the browser widget !?
So my question is:
- Does the "liveCode"-Object (LCs extension to the browser) interferes with external .js files ?
- Is this a known issue?
- work arounds?
- btw. i am using the community edition
Thanks in advance, Folko