I need to pass a variable from a js file into a html document for writting purposes. For example:
JS file (text.js)
-----------------
var wC='Hi my name is...'
HTML file (index.html)
----------------------
<html>
<body>
<script language="javascript" src="text.js">
document.write(wC)
</script>
</body>
</html>
QUESITON: How come I this doesn't work? It logically makes sense to me, but am unsure why it will not print the variable extraced from the JS file. I know the files are in the same directory...
Can anyone help?
JS file (text.js)
-----------------
var wC='Hi my name is...'
HTML file (index.html)
----------------------
<html>
<body>
<script language="javascript" src="text.js">
document.write(wC)
</script>
</body>
</html>
QUESITON: How come I this doesn't work? It logically makes sense to me, but am unsure why it will not print the variable extraced from the JS file. I know the files are in the same directory...
Can anyone help?