js example global function Example: access method globally js window.checkCookie = function(){ // do whatever you want here };