By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,480 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,480 IT Pros & Developers. It's quick & easy.

How can I get this code to run

P: n/a
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?

--
Thank you
Please post only
Dec 16 '05 #1
Share this Question
Share on Google+
4 Replies


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

--
Thank you
Please post only
"!!bogus" <he***@microb.com> wrote in message
news:oh******************@news20.bellglobal.com...
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?

--
Thank you
Please post only

Dec 16 '05 #2

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

test.js:

<script>
document.write(parameter)
</script>
"!!bogus" <he***@microb.com> wrote in message
news:PL*******************@news20.bellglobal.com.. .
I would like to be able to pass a parameter from the test.htm to the
test.js. This is my ultimate goal.

--
Thank you
Please post only
"!!bogus" <he***@microb.com> wrote in message
news:oh******************@news20.bellglobal.com...
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?

--
Thank you
Please post only


Dec 16 '05 #3

P: n/a
Michel wrote:
<script>
var parameter='yeah'
</script>
<script type="text/javascript" src="./test.js"></script>

test.js:

<script>
document.write(parameter)
</script>
_All_ `script' elements require the `type' attribute.
<URL:http://validator.w3.org/>

`script' element tags do not belong into script files,
that would _not_ be (X)HTML but a SyntaxError.

And
[top post]


is unwished here.
<URL:http://jibbering.com/faq/faq_notes/pots1.html#ps1Post>
PointedEars
Dec 17 '05 #4

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

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

test.js:

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

_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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.