Adding passive listeners to jQuery
Written By
Antonio Ortega
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- When running audit with Google Pagespeed is common to find a recommendation about implementing passive listeners for jQuery. How can we do this?
Environment
- Liferay DXP (any version)
Resolution
- Since jQuery is deprecated, and actually is disabled by default since Liferay DXP 7.3, we are not planning to add any new functionality to it, so this must be achieved through a custom development. To do so, we recommend you to use an extension point like /html/common/themes/top_head.jsp#post DynamicInclude.
- In order to know more about how to use DynamicInclude extension points in Liferay we recommend you to read the article Top Head JSP Dynamic Includes.
- In order to know which code to add to this specific case, we recommend you to have a look at the attached file MyDynamicIncludeJQuery.java. Consider this file as a reference rather than as a final solution since it might get outdated or it might need some small adjustments depending on the version.
Did this article resolve your issue ?