The following successfully calls a REST Services Module endpoint when contained in a module but I cannot get it to work within the script tags of a basic page.
(function ($) { var myapi = { 'apiPath': '/api/award' }; // REST functions. myapi.create = function (award) { $.ajax({ type: 'POST', url: 'http://localhost/testsite/api/award', data: JSON.stringify(award), dataType: 'json', contentType: 'application/json' }); }; myapi.create({ award : 'The Award' }); }(jQuery));
I am wondering if it is even possible to embed AJAX calls in a Basic Page.
Thanks for any help,
Orville