how to have a global variable that spans all files in javascript code example
Example: javascript global variable across files
var window.iAmGlobal = "some val"; //Global variable declaration with window.
//Any place in other part of code
function doSomething()
{
alert(window.iAmGlobal); //I am accessible here too !!
//OR
alert(iAmGlobal); //I am accessible here too !!
}