Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Java & JavaSript

Oct 4, 2012 1:44AM PDT

Hello. I am doing some rudimentary 'dabbling' at this time with 'JavaScript'. I am an absolute begginer.

Just a little 'semantics' to start off with. Somebody mentioned to me that both Java & JavaSc. are different...

I am pretty sure that J.S. is "just for" controlling how 'text' is displayed on a 'web page'. I was dabbling with a tutorial recently..and it instructed me to start that process using a notepad program I have on my computer..then having a sampling of text..by itself showing up on the screen 'in a certain' manner. Is that the main or only way ( using notepad) that J.S. is used or applied to 'web page construction?

Some web pages already have J.S. embedded into the web page that you might be viewing..but is usally hidden.

Is there a 'function' key that you can depress that would 'reveal' these hidden..JavaSripts or controls?

What is Java? by itself? Are they 'controls' that control how other things show up..besides text on 'web pages'?

Thanks for any and all responses
Bye
SC

Discussion is locked

- Collapse -
Answer
Re: java and javascript
Oct 4, 2012 1:58AM PDT

Indeed, Java and Javascript are different languages. Java is compiled into class files, which are executed by the Java runtime. Javascript is interpreted by a browser.

Javascript can do MUCH more than controlling how a webpage is displayed. You'll learn about that when studying. For example: http://www.webresourcesdepot.com/25-amazing-javascript-games-some-fun-and-inspiration/ has games written in Javascript.

It depends on the tool you use for making a webpage how to enter Javascript code in it. Notepad is a very basic tool. But you can use any other webdesign tool that supports it.

How to see the source of a webpage depends on the browser. It isn't a function key but a menu option.

Kees

- Collapse -
In addition
Oct 4, 2012 8:00AM PDT

there are a handful of great JavaScript libraries out there and that allow you to get things done by writing less code. One of those libraries is called jQuery. It's good to have a basic JavaScript foundation, but you'll often find that websites rely on this libraries. It makes sense, too, because you don't have to reinvent the wheel each time you want to do something simple that has been done before or people do a lot.

~Sovereign

- Collapse -
Answer
Limits are set by us. Example.
Oct 4, 2012 8:27AM PDT
- Collapse -
Answer
Java
Nov 15, 2012 1:13PM PST

Java, for what you are asking, is a programming language that lets you create programs or apps that are not limited to running on the web-browser. As long as you have on your Operating System of choice, JVM, the programs written in have can be compiled and run. You can use Java to create dynamic websites as well. However, unlike JavaScript, which runs on your browser, Java would run on the server - where the website is actually hosted. There are occasions where JavaScript is used to communicate with Java on the server. I guess I just wanted to point out they can and do coexist.
Abhi.