AJAX VS PHP动态网页?动态网页、AJAX、VS、PHP

2023-09-10 19:12:50 作者:↪别低头皇冠会掉

为什么要使用AJAX为动态网页的时候可以只用PHP做呢?

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

推荐答案

主要原因打扰AJAX是用户体验(UX)。

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

现在AJAX并不一定会提高UX在每一个实例,所以在很多地方贴的纯PHP是完全没问题的。

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

不过想象,你有一个文本字段在网站上的链接进行投票的东西的情况。有点像的网站的。当您添加AJAX的用户不会失去他们时,他们决定投票的链接的文本框输入的文字!多么的有用!

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!

所以,如果你关心你的用户体验是一个好主意,使用AJAX 在这样的情况下。

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

 
精彩推荐
图片推荐