Is the following valid javascript? Would the variable be available to the externally called script?
No its not, if you refer to a source the code between the script tags is ignored. You could do it like this: