global varibles in js code example
Example 1: create global variable inside function JavaScript
<script>
function foo() {
window.yourGlobalVariable = ...;
}
</script>
Example 2: javascript global function
window.my_function = function(){
//
}