Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

Using JSONP in jQuery

Hi

I have found a remote webservice that I am trying to invoke within jQuery but with no success:

http://www.holidaywebservice.com/Holidays/HolidayService.asmx/GetCountriesAvailable

Can any one please complete the code for me and retrieve a list of Names for me?

Thanks..
0
jonatec
Asked:
jonatec
  • 2
  • 2
1 Solution
 
Michel PlungjanIT ExpertCommented:
The URL you provide is XML, not JSON and has no callback...

You may need a proxy unless they have a JSONP interface too

http://developer.yahoo.com/javascript/howto-proxy.html
0
 
jonatecAuthor Commented:
Ok thanks for that, so please advise...

I want to call an external web service outside the domain, from a jQuery Ajax call, can I do this or do I need to wrap the call in a server component to do it?

Cheers..
0
 
Michel PlungjanIT ExpertCommented:
Unless they have a jsonp API or implement CORS yes you need to wrap
0
 
jonatecAuthor Commented:
Excellent, thanks for that !
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now