Geuis
10-23-2002, 07:24 PM
I am trying to pass the value of variables declared in the external file into the main html file/javascript coding that calls the external file.
Example:
(main html file, index.html)
<html>
<script language="Javascript" src="external.js">
</script>
<body>
<input name="textBox" type="text" value = importedVar>
</body>
<html>
(external JS file, external.js)
function externFunc()
{
var importedVar = "Test Successful"
}
-------------------------------------------------
With the end result that the textBox will display the value "Test Successful" in the final html page. I am not sure how to pass the variable correctly and continue to get errors when I use the code written above. Any assistance is appreciated.
Example:
(main html file, index.html)
<html>
<script language="Javascript" src="external.js">
</script>
<body>
<input name="textBox" type="text" value = importedVar>
</body>
<html>
(external JS file, external.js)
function externFunc()
{
var importedVar = "Test Successful"
}
-------------------------------------------------
With the end result that the textBox will display the value "Test Successful" in the final html page. I am not sure how to pass the variable correctly and continue to get errors when I use the code written above. Any assistance is appreciated.