Forgot Password

Is it a bad idea overuse JavaScript and Ajax in your web app ?

Or is there any other alternative?

Well, There’s nothing wrong with using AJAX and JavaScript in your web application.

In matter of fact, we build all of our frontend in pure JavaScript and all the requests are done via AJAX. Every single thing is done by AJAX on our frontend via JavaScript.

There are more cool people out there that build both frontend and backend in JavaScript. Nothing is wrong with that too.

All of this is based on the project requirements.

Now, if you need your web application to be indexed in Search Engines and be readable when JavaScript is disabled (bots, social media preview feature of a website, search engines, etc…) then you need to take care of that edge case.

Basically every web page that requires JavaScript to be enabled will not be fully covered in search engines. In order to do that you need to pre-render the pages with JavaScript requirement in the bakckend and send the data back to frontend.

You see, if you don’t take care of the pre-render case because you build the whole thing in JavaScript and indeed you need the page to be fully working without JavaScript, then you made a wrong decision about doing it in that way, other than that you should be pretty much fine.

By the way, as for alternatives to JavaScript, no there’s no alternative. You may use some other languages like TypeScript, CoffeeScript, etc that all transpile to JavaScript but at the end you’re stuck with JavaScript.

Alireza Savand • 2018 May 05

Be the first to comment.