In a JavaScript code in my JS file, I have the following function:
var obj, mtl;
init();
animate();
var MYLIBRARY = MYLIBRARY || (function () {
var _args = {}; // private
return {
init: function (Args) {
_args = Args;
// some other initializing
},
getValue: function () {
obj = _args[0];
mtl = _args[1];
}
};
} ());
Now, I am trying to pass a value to MYLIBRARY
so that I can use it. However, when I try to pass the value like this:
<script src="App_Themes/Assets/js/loaders/JScript.js" type="text/javascript"></script>
<script type="text/javascript">
MYLIBRARY.init(["obj/Dress/anarkali.obj", "obj/Dress/anarkali.mtl"]);
MYLIBRARY.getValue();
</script>
I encounter the following error:
Uncaught TypeError: Cannot read property 'substr' of undefined