Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is too much Ajax a bad thing?

I'm developing a site with a client side javascript framework (dojo/dijit) at the moment. As with all javascript/framworks you start using Ajax to do quick calls and updates. My question is there a general rule of thumb when to use Ajax and when to use a link? I only ask because I seem to be using Ajax more then not and I'm worried that any errors in the initial page might propagate to other elements. Or with content getting constantly replaced something might go wrong.

I suppose what I'm asking is there any downfalls to heavy Ajax usage in a web pages?

EDIT

SEO - not an issue. I'm just thinking of client server issues for now. Links would bet Ajax hands down if you wanted good SEO

like image 949
Robert Johnstone Avatar asked Oct 17 '11 08:10

Robert Johnstone


People also ask

Is using Ajax bad?

There's nothing wrong with using AJAX and JavaScript in your web application.

Is using Ajax good?

It is good for most of the websites, but I do not recommend to use it for entire application. Because we use it almost everywhere which all make some calls to the web server and increases the load even though it is not needed and which leads spending more time on it.

Do websites still use Ajax?

With interactive websites and modern web standards, Ajax is performed using functions within JavaScript frameworks and the Fetch API Standard.

What does Ajax do?

AJAX stands for Asynchronous JavaScript And XML. In a nutshell, it is the use of the XMLHttpRequest object to communicate with servers. It can send and receive information in various formats, including JSON, XML, HTML, and text files.


1 Answers

In my mind, there are three issues with using tons of AJAX calls.

The first is from a user perspective. If I am doing a lot of navigation, as a user, I want to be able to use my back/forward buttons in my browser and have them work correctly. If they do, then there isn't an issue. If they don't, you've broken fundamental navigation in my browser.

Second is bookmarking/indexing. As a user, I may want to bookmark something so I can come back to it or share it. As an indexer for a search engine, you as a developer want to let the search engine "see" all the pages of information you have so that people can find your site. Both of these require some sort of unique url.

Third is debugging from a development point of view. The more random stuff you are throwing on a page and/or replacing dynamically, the harder it gets to track down what's wrong. The more you have the more that needs to be integrated well or could interact badly.

like image 112
evan Avatar answered Oct 16 '22 02:10

evan