Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AJAX VS PHP for dynamic web pages?

Tags:

ajax

php

dynamic

Why use AJAX for dynamic web pages when you can do it only with php?

like image 578
dave Avatar asked Apr 02 '11 20:04

dave


People also ask

Do you have to use PHP with AJAX?

Ajax is just a technology to call server side scripts from Javascript. The server side script being PHP. So, if you intend to use Ajax, you need to know PHP. As for PHP frameworks, its good to build a few website from scratch using PHP to get a better understanding, but eventually, its better to adopt frameworks.

Is AJAX good for website?

Ajax is a web developer's best friend because it allows lazy loading to be done. Lazy loading is an optimization technique widely used to optimize online content. Ajax lets its users make asynchronous calls without having to reload the entire web page.

What is the difference between AJAX and PHP?

1. AJAX is a group of technologies that allows web applications to retrieve data from the server asynchronously; PHP is a scripting language designed to produce dynamic web pages. 2.

Is it better to use AJAX?

Reduce server traffic and increase speedThe first and foremost advantage of Ajax is its ability to improve the performance and usability of web applications. To explain more detailedly, Ajax techniques allow applications to render without data, which reduces the server traffic inside requests.


1 Answers

The main reason to bother with AJAX is User Experience (UX).

Now AJAX won't necessarily improve UX in every single instance so in a lot of places sticking with pure PHP is perfectly okay.

But imagine the case where you have a text field on the site and a link to vote on something. Kinda like this site. When you add AJAX your users won't loose the text they entered in the textfield when they decide to vote on the link! How incredibly useful!

So if you care about your user's experience it is a good idea to use AJAX in situations like that.

like image 58
Jakub Hampl Avatar answered Sep 20 '22 15:09

Jakub Hampl