Joomla: Ajax Interface without using jQuery

What is AJAX?

AJAX = Asynchronous JavaScript and XML.

AJAX is a technique for creating fast and dynamic web pages.

AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.

Examples of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook tabs.

How AJAX Works


AJAX is Based on Internet Standards

AJAX is based on internet standards, and uses a combination of:

  • XMLHttpRequest object (to exchange data asynchronously with a server)
  • JavaScript/DOM (to display/interact with the information)
  • CSS (to style the data)
  • XML (often used as the format for transferring data)




Now we can see how to pass values without using jQuery

Joomla currently introduce a new functionality Ajax Interface from Joomla 3.2.x you can see a component which was come with default package such as com_ajax it contain ajax by default so you need not include your ajax files.


You can find how to include this function with your component, module and plugin by see this tutorial


Git Hub:

Demo Component:

Demo Module:

Demo Plugin :


You may get a little knowledge from the above demo extension.


Now I will explain in detail

Now I will explain how to use the ajax funtion in detail. First we will start with component


In you custom component you need not include any jQuery Library because joomla inbuilt with jQuery ajax library you just need to create a jQuery script to pass variable asynchronous.


var url='index.php?option=com_yourcomponentname&format=raw&task=testFunction';
var data = 'value=1';
var request = new Request({
url: url,
data: data,
onSuccess: function(responseText){
some text...
some text...

Above code is usual method of passing ajax value here com_yourcomponentname is your component name and the magic will happen now

Now go to your component main controller contoller.php create the function testFunction

public function checkUservalue(){
$value=JRequest::getVar( 'value' );
echo 'The value is : '.$value;
echo 'No value';


This is same like component


Related Posts:

Leave a Reply

* Name:
* E-mail: (Not Published)
   Website: (Site url withhttp://)
* Comment:
Type Code