Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How can I get this code to run

Reply
Thread Tools

How can I get this code to run

 
 
!!bogus
Guest
Posts: n/a
 
      12-16-2005
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


 
Reply With Quote
 
 
 
 
!!bogus
Guest
Posts: n/a
 
      12-16-2005
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" <(E-Mail Removed)> wrote in message
newshsof.3597$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
 
Michel
Guest
Posts: n/a
 
      12-16-2005
<script>
var parameter='yeah'
</script>
<script type="text/javascript" src="./test.js"></script>

test.js:

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


"!!bogus" <(E-Mail Removed)> wrote in message
newsLsof.4989$(E-Mail Removed).. .
> 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" <(E-Mail Removed)> wrote in message
> newshsof.3597$(E-Mail Removed)...
> > 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
> >

>
>



 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      12-17-2005
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
 
Reply With Quote
 
Randy Webb
Guest
Posts: n/a
 
      12-18-2005
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Does Code in a Separate Thread Have to be in a <run()> or Called by a <run()>? KevinSimonson Java 7 10-18-2010 06:39 PM
run code run! Eugen Ciur Ruby 2 09-09-2010 05:17 PM
Can't Run 'RUN' Windows XP Home Luke O'Malley Computer Support 2 09-01-2005 11:38 PM
can run javascript can't run vbscript - WHY duncan ASP .Net 2 10-27-2004 09:31 AM



Advertisments