Replies: 2 comments 3 replies
-
Hello @aimanskie It will be difficult to help you without that. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Did you put that in a war ? |
Beta Was this translation helpful? Give feedback.
2 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
Hello Community,
I'm encountering a challenging issue with a portlet I developed for the eXo platform, specifically related to JavaScript execution and fetching API calls. While the portlet's UI (JSP file) loads without issues, the JavaScript responsible for executing fetch API calls doesn't run properly under normal user conditions. The functionality only works as expected after performing a clear cache and hard reset via Chrome DevTools, which is impractical to expect from end-users.
Here's what I've tried so far:
DOMContentLoaded Event: I've used document.addEventListener('DOMContentLoaded', ...) to ensure the DOM is fully loaded before running my script. This approach only seems effective after a hard reset.
MutationObserver: To address dynamic content loading, I experimented with a MutationObserver to detect when specific elements are available in the DOM. Unfortunately, this did not resolve the issue.
eXo.env.portal.onLoad Integration: I attempted to leverage eXo.env.portal.onLoad for better alignment with the platform's load events, but this also did not lead to the desired outcome.
The primary concern is that the JavaScript files, especially those handling fetch API calls, are not executing correctly under normal circumstances. This suggests a potential issue with script initialization or caching.
How can I ensure that my portlet initializes correctly for all users without requiring them to clear their cache or perform a hard reset? Are there specific strategies or lifecycle hooks in eXo platform that I should consider?
I appreciate any insights or suggestions you might have. Has anyone else encountered similar issues and found a workaround or solution?
Beta Was this translation helpful? Give feedback.
All reactions