Testing how to develop an app

This commit is contained in:
root
2022-03-14 20:05:46 +00:00
parent 1984e55837
commit a30a4f13ec
11 changed files with 99 additions and 38 deletions

View File

@ -0,0 +1,34 @@
var MyWiki = MyWiki || {};
(function(window, $, exports, undefined) {
'use strict';
$('#MyWiki-test').on('click',test);
function test() {
var baseUrl = OC.generateUrl('/apps/mywiki/wikis');
$.ajax({
url: baseUrl + '/test',
type: 'GET',
contentType: 'application/json'
}).done(function (response) {
// handle success
$('output').html(response);
}).fail(function (response, code) {
// handle failure
$('output').html('<h2>'+response.statusText+'</h2><code>'+response.responseText+'</code>');
});
}
/*
// if this function or object should be global, attach it to the namespace
exports.myGlobalFunction = function(params) {
return params;
};
*/
})(window, jQuery, MyWiki);