Shared Javascript across Apps
What is the best way to share Javascript between multiple apps? We have several apps that need shared functionality and I hate to just copy and paste. I see how a Javascript file can be used with page builder but what about app builder?
-
Hi Shane,
I hope this message finds you well.
Currently, AgilePoint does not provide native support for sharing JavaScript files across applications. However, there is an alternative method to achieve this objective, outlined below:
Approach: We can store the JavaScript file in a file system where it is publicly accessible. Then, we can load the file within a form using the "script" tag, as demonstrated in the code snippet below:
Script:
var sharedScript = document.createElement('script');
sharedScript.setAttribute('src', 'URL_TO_FILE');
document.head.append(sharedScript);This script can be incorporated either within a shared JavaScript file, which would be loaded in all forms requiring the global script, or it can be directly written within the JavaScript section of individual forms.
Please let me know if you have any questions or need further clarification on this approach.
請登入寫評論。
評論
1 條評論