I have created a clone button of "Save" button. When I modify any field and save it with the click of this clone button, it is saved. But while attaching/removing any file and saving this change using the click of this clone button, I got below error:
Access to strict mode caller function is censored
Any help in this !!
Below is the workaround provided in link.
function hackEventWithinDoPostBack() {
var originalEventDescriptor = Object.getOwnPropertyDescriptor(Window.prototype, "event");
var hackEventVariable = false;
var eventPropertyHolder;
Object.defineProperty(window, "event", {
configurable: true,
get: function get() {
var result = originalEventDescriptor ? originalEventDescriptor.get.apply(this, arguments) : eventPropertyHolder;
if (result || !hackEventVariable)
return result;
return {};
},
set: function set(value) {
if (originalEventDescriptor)
originalEventDescriptor.set.apply(this, arguments);
else
eventPropertyHolder = value;
}
});
var originalDoPostBack = window.__doPostBack;
window.__doPostBack = function hackedDoPostBack() {
hackEventVariable = true;
originalDoPostBack.apply(this, arguments);
hackEventVariable = false;
};
}