开发者

Ajax vs webservices

what is different between ajax and webservices. Anybody provide 开发者_如何学编程with some examples?


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.


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.


i think ajax and web services are kind of similar, here is why i think so. as i understood it, in your app sometimes you will have to implement an "API" which has several useful functions. and it is those functions which are called "web services". these 'functions' acts in response to the http requests and "does" something with the data provided. in ajax siimilar kind of work happens as well,just through javascript thats it. so, to sum it all up, an API has 'web services' within it, and ajax behaves like 'web services'. in this manner, yes i think it is correct to call ajax and web services similar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜