I am trying to run an external javascript function when the page loads and the function takes a variable that I can only pass through the page which where the javascript function is called from.
HTML Page
<head>
<script src="path/to/file.js" type="text/javscript>
window.onload = function() {
doFunction(variable);
}
</script>
</head>
Javascript file
function doFunction(variable){
//do the stuff here
}