In my project, I have a typescript file named "menuTree.ts" which compiles to the following JavaScript code:
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var MenuTree = /** @class */ (function () {
function MenuTree() {
}
MenuTree.prototype.refreshTree = function (bereichId, page) {
var _this = this;
};
return MenuTree;
}());
exports.MenuTree = MenuTree;
});
//# sourceMappingURL=menuTree.js.map
This JavaScript code is included in a separate JavaScript file within the head section of my web page:
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="menuTree" src="http://localhost:65013//Assets/Scripts/Javascript/menuTree.js"></script>
Now, further down in the body section, I want to trigger the "refreshTree" function when clicking on an anchor tag:
<a onclick='javascript: return refreshTree(1, 2)'>Refresh</a>
However, I keep encountering an error message stating that refreshTree is not defined. I also attempted using MenuTree.refreshTree(1, 2) without success.
I would greatly appreciate any assistance with this issue. Thank you!