Adding JavaScript to your digital workplace
Overview
Insert JavaScript (JS) into your digital workplace to add your own custom functionality.
For more information about using JS in your digital workplace, go to the Igloo Developers Center.
Considerations and caveats
Who can do this
- Workplace administrators
- Enterprise administrators
- Space administrators (only within their Space)
- Members of groups with the Edit JS Role (only via the Advanced page)
Inline vs. External
Avoid placing your JS inline; instead, reference it as an external file. One way to do this is to upload your code to a Folder Channel in your digital workplace, and then insert a reference to that file where you want your JS to run. To get this file's URL:
- Go to the file.
- Right-click the download button, and select Copy link address.
- (Optional) Remove the domain from the copied URL.
A reference to a JS file in your workplace would look similar to this:
<script src="/download/my_folder/helloworldjs;v1?attachment=1" type="text/javascript"></script>
Testing
Before deploying your JS to your digital workplace, test it in your digital workplace preview. Should anything go wrong, there will be no impact on other members of your digital workplace.
Where to add JavaScript to your digital workplace
Where you place your JS is determined by where you want it to run.
JS should run on every page of a digital workplace
Place your JS in your in the Code View of your digital workplace's Footer.
JS should only run within a Space
Place your JS in the in the Code View of the Space's Footer.
JS should only run on a Page or Channel
Place your JS in the JavaScript Code section on the Advanced page of a Page or Channel.