Consuming RESTful web services with jQuery

Greetings,

I need to find a tutorial on this topic, something that gives a well-defined, high-level view as well as (if possible) some actual coding examples to work through so I can get a feel for this type of work.  

Regarding details, I need something that (preferably) deals with the Zend Framework and output in JSON.

Thanks.
LVL 1
max7Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
max7Author Commented:
Thanks for that ... if I'm not mistaken, both links point to the same article.

Also, this tutorial deals only with ASMX which I believe is related to .NET web technology.  Anything related to PHP out there?
0
 
Gurvinder Pal SinghCommented:
actually it doesn't matter which is the server side technology, since the format of request and response is decided  by your rest service and protocol is anyways same http.

So, go ahead and try the same
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
leakim971PluritechnicianCommented:
0
 
max7Author Commented:
>>>actually it doesn't matter which is the server side technology, since the format of request and response is decided  by your rest service and protocol is anyways same http.

So basically, are you saying that if the output is in JSON, the way jQuery would handle that response is the same, regardless whether or not it's a PHP or .NET backend?
0
 
max7Author Commented:
leakim971:  that's a great example but I don't see where jQuery is used to consume the web service.  Please pardon my ignorance if it's apparent but could you point it out to me?
0
 
leakim971PluritechnicianCommented:
You want to consume the wb at the server side (php/zend) or from the client side (jquery) ?
0
 
max7Author Commented:
I need to consume from the client side using jQuery.  the web services are RESTful and output JSON.
0
 
leakim971Connect With a Mentor PluritechnicianCommented:
with jQuery this can be a simple line : http://api.jquery.com/jQuery.getJSON/

You need to have the same domain and protocol for the client and the server ( url in the browser and url in the ajax call $.getJSON(url,callbackFunction

else you need to handle JSONP on the server or use a proxy

$.getJSON("/path/to/webservice/youfunction/param1", function(data) {
      // do something with the data back if needed
});

Open in new window

0
 
max7Author Commented:
Undoubtedly, I will have more questions on this topic but for now this is a good start.  Thanks to you both.
0
All Courses

From novice to tech pro — start learning today.