Page 1 of 3

JavaScript ain’t Java

Posted: Tue May 31, 2011 7:37 pm
by maik
Moderator: This post is a response to this question.

JavaScript

Re: FuelCollector...???

Posted: Tue May 31, 2011 8:06 pm
by greenseng
maik wrote:


Okay. Have never dealt with any type of Java.
People always talks about that there is a difference between Java and Javascripts.
I have seen java-scripts used in webpages. At least I think they are java-scripts.
Maybe they are called java-scripts because they are using already existing routines from a java library.
Or they are using java syntax.
If it is that both my ideas here are wrong: why call it java in javascripts?
They like coffee?

Well - have learned one thing in life.
There are no superbeings to be found.
If there exists a living being somewhere in universe that can learn to handle any type of java.
Then I can do it too.
It is just a matter of interest, inspiration and fun.
Nothing else.




Re: FuelCollector...???

Posted: Tue May 31, 2011 8:08 pm
by DaddyHoggy
Follow the link maik posted (i.e. click on the word Javascript).

Java != javascript

Re: FuelCollector...???

Posted: Tue May 31, 2011 8:11 pm
by JensAyton
greenseng wrote:
If it is that both my ideas here are wrong: why call it java in javascripts?
Marketing. It was originally called LiveScript, but people with pointy hair changed the name (and the syntax) because Java was the Next Big Thing.

JavaScript looks superficially like Java, but they’re completely different in almost every aspect of how they work.

Re: FuelCollector...???

Posted: Tue May 31, 2011 8:34 pm
by CommonSenseOTB
greenseng wrote:
maik wrote:


Okay. Have never dealt with any type of Java.
People always talks about that there is a difference between Java and Javascripts.
I have seen java-scripts used in webpages. At least I think they are java-scripts.
Maybe they are called java-scripts because they are using already existing routines from a java library.
Or they are using java syntax.
If it is that both my ideas here are wrong: why call it java in javascripts?
They like coffee?

Well - have learned one thing in life.
There are no superbeings to be found.
If there exists a living being somewhere in universe that can learn to handle any type of java.
Then I can do it too.
It is just a matter of interest, inspiration and fun.
Nothing else.



No, I like coffee. Do you have issues of scale? :P

Re: FuelCollector...???

Posted: Tue May 31, 2011 10:24 pm
by greenseng
DaddyHoggy wrote:
Follow the link maik posted (i.e. click on the word Javascript).

Java != javascript



Ohh... hmm...

I am a novice here - so don't laugh your head off.
When you are new to something, the universe suddenly explodes with information - and one does not know where to start or what is what...
A very simple question ( probably very stupid )...


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>simple page</title></head>
<body>
<script type="text/javascript">
document.write('Hello World!');
</script>
<noscript>
<p>Your browser either does not support JavaScript, or you have JavaScript turned off.</p>
</noscript>
</body>
</html>


Why are they using the tag <noscript> here? They have already used the the tag </script> ?


Re: FuelCollector...???

Posted: Tue May 31, 2011 10:27 pm
by DaddyHoggy
<script> is what it does if it finds that you're running javascript

<noscript> what it says on the tin - it prints a message to say that it can't run the script because either you don't have javacript installed or you have it turned off

Re: FuelCollector...???

Posted: Tue May 31, 2011 10:28 pm
by greenseng
Ahruman wrote:
greenseng wrote:
If it is that both my ideas here are wrong: why call it java in javascripts?
Marketing. It was originally called LiveScript, but people with pointy hair changed the name (and the syntax) because Java was the Next Big Thing.

JavaScript looks superficially like Java, but they’re completely different in almost every aspect of how they work.


Okay. I see.

Think I have to dig a little deeper into this.
This is somehow... call it interesting.


Re: FuelCollector...???

Posted: Tue May 31, 2011 10:29 pm
by JensAyton
greenseng wrote:
Why are they using the tag <noscript> here? They have already used the the tag </script> ?
Firstly, this is actually an HTML question, not a JavaScript one. The JavaScript used in Oolite isn’t embedded in HTML. On the other hand, there’s no Oolite-centric JavaScript tutorial.

In HTML, the noscript element contains content that’s only used if JavaScript is disabled or not supported by the browser being used. The content of the noscript tag is ignored if JavaScript is off, and the content of the script element is ignored if JavaScript is on.

Re: FuelCollector...???

Posted: Tue May 31, 2011 10:30 pm
by Smivs
greenseng wrote:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>simple page</title></head>
<body>
<script type="text/javascript">
document.write('Hello World!');
</script>
<noscript>
<p>Your browser either does not support JavaScript, or you have JavaScript turned off.</p>
</noscript>
</body>
</html>


Why are they using the tag <noscript> here? They have already used the the tag </script> ?

[/color]
The first part is telling a browser to display a message "hello world" using javascript
The <noscript> displays the message "Your browser either does not support JavaScript, or you have JavaScript turned off." if the browser trying to display the message does not support javascript or has it switched off.

Re: FuelCollector...???

Posted: Tue May 31, 2011 10:33 pm
by greenseng
DaddyHoggy wrote:
<script> is what it does if it finds that you're running javascript

<noscript> what it says on the tin - it prints a message to say that it can't run the script because either you don't have javacript installed or you have it turned off


Okay. I see.


Re: FuelCollector...???

Posted: Tue May 31, 2011 11:05 pm
by greenseng
CommonSenseOTB wrote:
greenseng wrote:
maik wrote:


Okay. Have never dealt with any type of Java.
People always talks about that there is a difference between Java and Javascripts.
I have seen java-scripts used in webpages. At least I think they are java-scripts.
Maybe they are called java-scripts because they are using already existing routines from a java library.
Or they are using java syntax.
If it is that both my ideas here are wrong: why call it java in javascripts?
They like coffee?

Well - have learned one thing in life.
There are no superbeings to be found.
If there exists a living being somewhere in universe that can learn to handle any type of java.
Then I can do it too.
It is just a matter of interest, inspiration and fun.
Nothing else.



No, I like coffee. Do you have issues of scale? :P


...issues of scale? New expression for me. English is not my mothertounge.

About coffee.

I once bought raw coffeebeans. Beans that were not roosted.
I had a frying-pan that I did not use so I roosted them there.
I then grinded them. Think it is called grind in english - you make them being powder.
I then made an espresso.
It had a thick layer of brown crema. Something new to me.
I tasted it and got the shock of my life.
I leaned back in the chair, looked out of the window and saw the stars.
- You sons and daughters of ... I don't know what. Why havn't you told me about this before?
It was beyond any doubts the best cup of coffee I ever tasted.

This can have been the result of a beginners luck, I thought.
But if not I have entered a totally new universe.



Re: JavaScript ain’t Java

Posted: Tue May 31, 2011 11:42 pm
by CommonSenseOTB
:D

Good coffee. Your speaking my language!

I'll try and speak yours a little better.

On this board lately everyone is talking about the scale of things. How big are the ships, how big are the planets, how fast do the ships go, what are the distances involved, all in this game compared to what the numbers should be in reality.

I've been making the joke that "when I have issues of scale" in reference to my coffee maker and that I use vinegar to remove the scale- the buildup of minerals from boiling water. Same word, different meaning, that's the joke(or the attempt at the joke). :lol:

Most people write english so well on this board that I forget that it is not a first language for them. I salute you all and canadians are not bilingual for the most part(except in quebec where it's quite common because french is the first language for many there.)In the future I will remind myself that my humor might not be translating well or even be shared.Oh well...

Re: FuelCollector...???

Posted: Wed Jun 01, 2011 7:32 am
by Thargoid
Ahruman wrote:
In HTML, the noscript element contains content that’s only used if JavaScript is disabled or not supported by the browser being used. The content of the noscript tag is ignored if JavaScript is off, and the content of the script element is ignored if JavaScript is on.
I think you have that last line backwards...

Re: FuelCollector...???

Posted: Wed Jun 01, 2011 8:22 am
by JensAyton
Thargoid wrote:
Ahruman wrote:
In HTML, the noscript element contains content that’s only used if JavaScript is disabled or not supported by the browser being used. The content of the noscript tag is ignored if JavaScript is off, and the content of the script element is ignored if JavaScript is on.
I think you have that last line backwards...
Indeed. But apart from that, it was a nice and accurate explanation. ;-)