JavaScript ain’t Java

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

JavaScript ain’t Java

Post by maik »

Moderator: This post is a response to this question.

JavaScript
User avatar
greenseng
Dangerous
Dangerous
Posts: 125
Joined: Thu May 19, 2011 3:27 am

Re: FuelCollector...???

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



User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: FuelCollector...???

Post by DaddyHoggy »

Follow the link maik posted (i.e. click on the word Javascript).

Java != javascript
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: FuelCollector...???

Post 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.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: FuelCollector...???

Post 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
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
greenseng
Dangerous
Dangerous
Posts: 125
Joined: Thu May 19, 2011 3:27 am

Re: FuelCollector...???

Post 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> ?

User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: FuelCollector...???

Post 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
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
greenseng
Dangerous
Dangerous
Posts: 125
Joined: Thu May 19, 2011 3:27 am

Re: FuelCollector...???

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

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: FuelCollector...???

Post 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.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: FuelCollector...???

Post 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.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
greenseng
Dangerous
Dangerous
Posts: 125
Joined: Thu May 19, 2011 3:27 am

Re: FuelCollector...???

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

User avatar
greenseng
Dangerous
Dangerous
Posts: 125
Joined: Thu May 19, 2011 3:27 am

Re: FuelCollector...???

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


User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

Re: JavaScript ain’t Java

Post 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...
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: FuelCollector...???

Post 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...
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: FuelCollector...???

Post 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. ;-)
Post Reply