Developing the Javascript Client
Jump to navigation
Jump to search
Some quick hints
Ajax calls
- We are using the axios library for ajax calls: https://github.com/axios/axios
- We have our own wrapper around it: https://github.com/openpetra/openpetra/blob/master/js-client/src/lib/ajax.js#L31
- We make calls to the API, as it is available here: https://demo.openpetra.org/api/
- We want the result formatted as JSON. This only works with post, not with get, and with at least an empty list of parameters. Otherwise you get the result formatted in XML.
Example:
api.post('serverMSysMan.asmx/TMaintenanceWebConnector_LoadUsersAndModulePermissions', {}) .then(function(response) { ...