I have two script:
scipt1.js:
(function ($) {
‘use strict’;
var A = function (element, options) {
this.element = $(element);
};
A.prototype.update = function update() {}
$.fn.doA = function (option) {
return this.each(function test() {
newA = new A(this, options);
}
});
};
}(jQuery));
And scipt2.js from incline html:
$( document ).ready(function(){
$('#$this->id').doA($javascriptParameterString);
});
In $( document ).ready(function().. from script2.js, I want to call the function update from scipt1.js after doA executed. Is there anyway I can reference the instance newA and call that function update?