I do not have access to edit the js file.
Then you cannot stop completely. It is completely closed to the anonymous IIFE * that covers it. You must expose it as global in order to use it with the onxyz-attribute-style event handler (and this will require changing the JavaScript code). This is one of many reasons not to use them.
JavaScript, , , , / JavaScript:
IIFE data-*, , :
var cr = {};
cr.plugins_ = {};
cr.runtime = null;
cr.plugins_.Vinoos_Markets = function(runtime) {
this.runtime = runtime;
};
(function() {
function initialize_events(result) {
alert(result);
}
document.getElementById("send-result").addEventListener("click", function() {
initialize_events(this.getAttribute("data-result"));
}, false);
}());
<button id="send-result" data-result="Test Result">Send Result</button>
:
addEventListener (, IE8, , , ), . - .- IIFE, , ,
data-*. - ID
getElementById - ; , , , . CSS- document.querySelector.
* IIFE = , , (function() { /*...*/})(); ( " inline-called". " ", : , , .)