I am passing some variable from my gwt code to the jsp file. It is something like this
<html>
<head>
<script type="text/javascript">
alert("Inside the jsp file");
var criticalPath = window.top.criticalPath;
</script>
</head>
<body>
<script type="text/javascript" src="./js/flow.js"></script>
</body>
</html>
What i want is to pass the criticalPath variable to the flow.js file. I know if, flow.js would be a method I could have pass the variable, but I don’t want to do that way. Is there any way to avoid the method and pass the variable to flow.js or can I call the window.top.criticalPath inside the flow.js?
You didn’t place the variable
criticalPathin any specific scope, which means it is a global variable, and hence it will be accessible from any js file (as long as they are loaded aftercriticalPathdeclaration.