How can I get this code to run

B

!!bogus

The following is the contents of test.htm
<html>
<body>
<script type="text/javascript" src="./test.js"></script>
</body>
</html>

the following is the contents of test.js
document.open()
document.write("&lt;html&gt;<BR>")
document.write("&lt;h1&gt;test&lt;/h1&gt;<BR>")
document.write("&lt;/html&gt;")

I would like to have to code in test.js execute instead of being printed.
How can I do that?
 
B

!!bogus

I would like to be able to pass a parameter from the test.htm to the
test.js. This is my ultimate goal.
 
M

Michel

<script>
var parameter='yeah'
</script>
<script type="text/javascript" src="./test.js"></script>

test.js:

<script>
document.write(parameter)
</script>


!!bogus said:
I would like to be able to pass a parameter from the test.htm to the
test.js. This is my ultimate goal.
 
T

Thomas 'PointedEars' Lahn

R

Randy Webb

Thomas 'PointedEars' Lahn said the following on 12/17/2005 1:28 PM:
Michel wrote:




_All_ `script' elements require the `type' attribute.
<URL:http://validator.w3.org/>

Name a browser that handles <script type="text/javascript"> differently
than it does <script> and that might actually mean something. The only
time that it even matters is in IE and that is if and only if there is a
meta element to declare vbscript the scripting language, or, a VBScript
script element in the page prior.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top