I have a javascript file with this code:
(function () {
var cookieconsent = {
dismiss: function (evt) {
evt.preventDefault && evt.preventDefault();
evt.returnValue = false;
this.setDismissedCookie();
this.container.removeChild(this.element);
},
setDismissedCookie: function () {
Util.setCookie(DISMISSED_COOKIE, 'yes', this.options.expiryDays, this.options.domain, this.options.path);
}
};
})();
How can I access the function "dismiss" from, let's say, the console of the browser or an a href link on the page?
This is the source of the file: Cookie Consent - GitHub
Thanks!
cookieconsent
is local to the anonymous function in which it is declared. It is not visible or accessible outside that function (at least, not according to the code you posted). – Pointy Jun 1 '16 at 13:48