Advantages and disadvantages of Ajax and how to use jQuery

AJAX ( Asynchronous JavaScript and XML ) is a web development technique that by combining a number of separate technologies, allows us to exchange information between the server and client (web browser) asynchronously. As a result, we obtain an agile, quick and dynamic navigation; and also the possibility of making changes on a website without updating.

Independent technologies that enable AJAX are:Ajax diagram

 

  • JavaScript: It is the foundation that unites these technologies
  • XMLHttpRequest: asynchronous Exchange
  •  XML: Handling and exchange of information
  • JSON: Alternative XML (currently more used than XML)
  • DOM: Document Object Model
  • XHTML and CSS Styles – Creating a presentation of objects

The benefits of AJAX are:

  • Improved user experience
  • It can be used on any platform and browser
  • Lower transfer client/server
  • Resource Optimization (operating time)
  • Portability and usability (allows a request to the server and receive data without loading the whole page)

Disadvantages of AJAX are:

  • JavaScript must be enabled in your web browser to run
  • Preferably using AJAX contact forms, email validation and passwords to not affect the search engine optimization (SEO)
  • Server response times at certain times
  • Development time (you need to have medium/high knowledge of the technologies that make up AJAX)
  • Some functions that are used in web browsing may not work as expected. For example, the back button, keep score or update the website at any time.

The weakness of AJAX is that you need to write code for each browser that use, and this requires much time. However, jQuery comes to the rescue by allowing us to use AJAX and its potential with a single line of code:

To understand the use of jQuery AJAX we will make an example where we can see the used methods:

In this example, we use the load ()method to load our .xml file, and thus it displays on the screen.

Another example of how to implement a method would be:

Using the methods we can implement jQuery AJAX elements and functions on our websites achieve surprising results.

WBD Team

Our excellent WBD team working day and night to put together best content for you.

You may also like...