Click to See Complete Forum and Search --> : First Step in Coding Javascript


dowillem
12-17-2005, 06:22 PM
Sorry to ask such a dumb question, but I need to start out:

If I see code in Javascript that I want to use, what do I do with it to make it work? I mean, I know how to save it into its own txt file, but then what? I opened it in a browser - Opera - and it just saw the code all over again. How to "invoke" the code? Is there some kind of compilier?

:rolleyes:

Kravvitz
12-17-2005, 09:02 PM
A) Don't use such a large font-size.

B) JavaScript is a scripting language; it has an interpreter, not a compiler.

C) http://www.faqs.org/docs/htmltut/scripts/_SCRIPT_SRC.html

dowillem
12-18-2005, 09:01 AM
Thks for reference site - I'll try to study it and see if I can learn it there. Sorry about the font size - I chose size 7, and worried it that was large enough - I was thinking it was like font point size in a word processor.

Kravvitz
12-19-2005, 12:45 AM
You're welcome :)

Didn't you think it was odd that the largest size was 7?

FYI, you don't need to specify a font size.

HTML has 7 font sizes. (http://www.w3.org/TR/html401/present/graphics.html#edef-FONT)

The <font> element has been superseded by CSS, so don't use it, just be aware of it.

You should be aware that there is a feature that allows you to edit your own posts on these forums.

w3goodie
12-19-2005, 08:43 AM
hi Dowillem,
If u simply want to run the javascript code...place your code in b/w <script></script>tags

<script language="JavaScript">
Place your javascript code here
</script>

save the file as filename.htm or filename.html

open the file in any browser

Charles
12-19-2005, 09:06 AM
<script language="JavaScript">
Place your javascript code here
</script>That's a depricated example. Use instead:<script type="text/javascript">

</script>