Ajax vs webservices

what is different between ajax and webservices. Anyone give some examples?

+4
source share
3 answers

Commonly used term is Ajax ":

  • When a request is sent by the browser (client side) to the server
  • When the data is XML or JSON or HTML.


The most commonly used word is webservice ":

  • When a request is sent by a server to another server, without a browser
  • When the data transferred is SOAP - at least when it is a SOAP ^^ web service (for example, opposite to REST, which usually does not imply SOAP)


But I would say that Ajax is basically a specific web service.

+4
source

It is pointless to compare these things.

"Ajax" is a process that happens in a browser. This is a call to call the local local server page without updating the "main" viewing area, and then performing various actions with this result (data capture, making changes, changing the existing DOM (adding elements)).

Web services is a server-side thing that allows you to call methods in your code, but this call is actually sent to the remote computer. A web service call is usually also made on the server side.

+3
source

I think ajax and web services are similar, which is why I think so. as I understand it, sometimes in your application you will have to implement an "API", which has several useful functions. and these are the features called "web services." these "functions" act in response to HTTP requests and "do something" with the data provided. in ajax siimilar kind of work as well, just through javascript thats this. therefore, to summarize, the API has “web services” in it, and ajax behaves like “web services”. that way, yes, I think it's right to call ajax and web services similar.

-1
source

Source: https://habr.com/ru/post/1300708/


All Articles