Ajax Usage in WordPress

15.ajax

Info provider

AJAX is a JavaScript based technology which allows a web page to get new information and present itself without refreshing the page. AJAX aims to make the web page more responsive and interactive from the user’s point of view.

Usually you should refresh a web page to view new information. For instance, when you fill out an online form like a credit card purchase online, in some sites you need to click next to let you know if you filled out something incorrectly. Anyway, with AJAX, the form lets you know if you filled out something incorrectly. It can also let you know if you’ve already made a previous purchase, or if your credit card is expired. AJAX is viewing online maps. Before AJAX, Google Maps required you to click the arrows to navigate their maps. The page had to reload to see the new portion of the map you were interested in. However, Google Maps now utilizes the power of AJAX to carry the new portions of the map and “redraw” the page where the map moves.

Technology

Ajax technology is really simple to describe. The web programmer connects a link, button, or some other type of user interface element on the web page to a JavaScript program. When the user activates the interface, the JavaScript program sends some information or a request for data to a URL on the web server. Next, a program on the web server processes the request and sends back a response or some data. Normally the data is in XML format, but that’s not actually required. When the data or response gets to the browser, the JavaScript program receives an “asynchronous” notification, so that you can process or display it appropriately.

Support

Now, Ajax is supported by most visual web browsers. Of course, like most complex JavaScript, there are differences between the way browsers implement JavaScript. Anyway, these are not too difficult to overcome. The only real restriction on Ajax is that the URL you send the information to has to be on the same website as the URL the JavaScript came from. The uses for the technology are only limited to what you can figure out how to program.

Ajax technology is being adopted by all sorts of websites due to its responsiveness, and WordPress is not an exception. Currently, the core of WordPress uses Ajax only in the administration screens. For example, Ajax is used for instant updates when you are doing comment moderation, or when you are adding and deleting items from lists such as categories, blogroll, and posts. Ajax is also the technology behind the auto-save functionality on post and page editing screens. Several themes and plugins use Ajax as well; for example, some post rating plugins use Ajax to store the visitor’s rating in the database and then display an updated average rating.

Hope you liked this article!

Share this!

Post Author: Staff

Leave a Reply

Your email address will not be published. Required fields are marked *