Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax vs webservices

what is different between ajax and webservices. Anybody provide with some examples?

like image 811
JohnRaja Avatar asked Feb 09 '10 07:02

JohnRaja


2 Answers

It's nonsensical to compare these things.

"Ajax" is a process that occurs in the browser. It is the act of calling some local server-side page, without refreshing the "main" viewing area, and then doing various things with that result (grabbing the data, making changes, changing the existing DOM (adding elements), whatever).

Webservices are a Serverside-thing that allows you to call methods, in your code, but have that call actually go to a remote machine. The call to the Webservice is generally also made server-side.

like image 78
Noon Silk Avatar answered Sep 20 '22 04:09

Noon Silk


The term "Ajax" is generally used :

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


The word "webservice" is generally used :

  • When the request is sent by a server to another server, without a browser being involved
  • When the transfered data is SOAP -- at least when it's a SOAP webservice ^^ (Opposed to REST, for instance, which generally doesn't imply SOAP)


But I'd say that Ajax is basically some specific kind of webservice.

like image 21
Pascal MARTIN Avatar answered Sep 22 '22 04:09

Pascal MARTIN