Ticket #153 (new task)

Opened 5 years ago

Last modified 5 years ago

AJAX request from JavaScript service

Reported by: surf9 Owned by:
Priority: minor Milestone:
Component: Development platform Version:
Keywords: Cc:

Description (last modified by djay) (diff)

Hi there

Is it possible to carrying out an AJAX request from inside a JavaScript service?

E.g. I would like to perform a WFS request on third-party APIs

Can I do this with jQuery? How do I add jQuery so it's accessible from a JavaScript service in Zoo?

I also tried using XMLHttpRequest, but I'm getting "not defined" error.


Change History

Changed 5 years ago by djay

  • description modified (diff)

Hello, It is possible to call HTTP requests, the documentation to do so is here: http://zoo-project.org/docs/api/zoo-request.html .

I never have tried to use jQuery on the server side. It will probably require some modification to make it usable server-side, I guess.

Indeed, there is no XMLHTTPRequest on the server side, this is the reason why we have developed the JavaScript ZOO-API to add some functions like JSRequest.

Hope it helps.

Changed 5 years ago by surf9

Thanks for the pointer. That helped!

Just wondering, how do I include the ZOO-api.js file inside my own JS service file?


Changed 5 years ago by djay

You don't have to include the ZOO-api.js file from your service code. It will be automatically loaded but the ZOO-Kernel if it find the file in the location where the ZOO-Kernel stand. Take a look here.

Hope it helps.

Note: See TracTickets for help on using tickets.


Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png