Select your language

Sign up
AJAX

AJAX (Asynchronous JavaScript and XML) is a web development approach in which JavaScript exchanges data with a server and updates part of a page without a full reload. Joomla websites use AJAX for features such as search suggestions, catalogue filters and form submissions.

How AJAX works

A user action causes a script to send an HTTP request. The server processes it and returns a response, then the script updates the relevant interface area. The page remains open. Requests can be made with fetch or XMLHttpRequest.

Despite XML in the name, XML is not required. Responses often contain JSON, HTML or plain text. AJAX is neither a separate programming language nor a specific library.

Not every page change uses AJAX

A tab or modal window can open entirely within the browser, without a network request. Even a changing basket counter does not by itself prove that the server has saved the data. Check the Network panel in browser developer tools to inspect the exchange.

AJAX in Joomla

Joomla extensions may handle requests through their own controllers. The com_ajax interface supports certain module and plugin tasks. The route, response format and access checks depend on the extension, so using Joomla does not automatically make every request safe.

Operations that change data require server-side input validation, permission checks and CSRF protection. Browser checks cannot replace them. Responses containing untrusted data must be displayed safely.

Errors and usability

Show a loading state and a clear operation result. Handle connection failures and server errors instead of leaving a permanent spinner. Prevent accidental duplicate submissions. Updated regions should remain keyboard-accessible and understandable to screen reader users.

Summary

AJAX helps a Joomla site update data without a full page reload. A reliable implementation also needs error handling, an accessible interface and server-side checks.

Mentions:

CSRF, DOM, JComments, JSON, XSS, ZOO

Newsletter Subscription
Enter your email address and we will keep you updated!

Joomla.center is not affiliated with or endorsed by the Joomla!® Project or Open Source Matters. The Joomla!® name and logo is used under a limited license granted by Open Source Matters, the trademark holder in the United States and other countries.