I am developing a plugin of table export at client-side. Plugin works fine. But when I validated my code in jshint, it throws me an error saying possible strict violation. Below is the function:
function disableExport(){
if(_(this).exportPlugin !== undefined){
_(this).exportPlugin.setStyle('pointer-events', 'none');
_(this).exportPlugin.find('.ebIcon').removeModifier('interactive','ebIcon');
_(this).exportPlugin.find('.ebIcon').setModifier('disabled','','ebIcon');
}else{
console.log('ERROR!');
}
}
And it says: "If a strict mode function is executed using function invocation, its 'this' value will be undefined."
Complete code of plugin is available on https://jsfiddle.net/t47L8yyr/
How do I resolve this ? any other solution than using /*jshint validthis:true*/