This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
espocrm-base/frontend/test/jet-test.js
T
Yuri Kuznetsov 99195313c5 add frontend
2014-04-11 11:44:02 +03:00

42 lines
743 B
JavaScript

(function ($) {
var root = this;
root.Espo = {};
this.EspoTest = {
include: function (path, options) {
var thisObject = root;
if (options != undefined && 'self' in options) {
thisObject = options.self;
}
var self = this;
var ajaxOptions = {
url: path,
async: false,
cache: false,
type: 'GET',
dataType: 'text',
success: function (script) {
eval.call(thisObject, script);
},
error: function () {
console.error("Error occured while loading " + path);
}
};
if (typeof options != 'undefined') {
_.each(options, function (value, key) {
ajaxOptions[key] = options[key];
});
}
$.ajax(ajaxOptions);
},
};
}).call(this, $);