how to make a function global in javascript code example
Example 1: access method globally js
window.checkCookie = function(){
// do whatever you want here
};
Example 2: create global variable inside function JavaScript
<script>
function foo() {
window.yourGlobalVariable = ...;
}
</script>