This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-02 23:39:52

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Javascript topic

After looking through the threads in MaC containing things about javascript, I saw that there is no topic for Javascript in general. Hence I made this. Talk about javascript here.

I just started and was able to make a madlib sort of thing.

Code:

var name=prompt("Please enter a name","Bob");
var food=prompt("Please enter the name of a food","Chips");
var transportation=prompt("Please enter the past tense of a way of transportation","Drove");
var shop=prompt("Please enter the name of a market","Market");
var number1=prompt("Please enter a number","17");
var number2=prompt("Please enter another number","35");
var adjective=prompt("Please enter an adjective","happily");
var feeling=prompt("Please enter a feeling","happy");
var x=name+" wanted to eat some "+food+". "+name+" "+transportation+" to the "+shop+" and went to isle "+number1+". "+name+" walked down "+number2+" feet until "+name+" reached the "+food+". "+name+" purchased the food and "+transportation+" home. Then, "+name+" "+adjective+" ate the food and felt "+feeling+".";
document.getElementById("spotformadlibs").innerHTML=x;

On the very last line where it says the ID is spotformadlibs, it is what it says (yes, I know it is a very short madlib).

Offline

 

#2 2012-06-03 05:05:06

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Javascript topic

I suck at JS. I can only write short scriplets such as "onClick".  sad

Still, thanks to your madlib, I now know what innerHTML does.  smile


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#3 2012-06-03 05:06:54

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Javascript topic

I wanted to learn it but forgot about it.


http://trinary.tk/images/signature_.php

Offline

 

#4 2012-06-03 12:56:38

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Javascript topic

SciTecCf wrote:

I suck at JS. I can only write short scriplets such as "onClick".  sad

Still, thanks to your madlib, I now know what innerHTML does.  smile

It is exactly what it says it is. The HTML that's supposed to be there.

What I think is pretty awesome is that some guys created games, raycasters, simulations, in javascript. Here's the raycaster.

Anyone else use javascript?

Offline

 

#5 2012-06-03 13:00:35

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

Re: Javascript topic

TorbyFork234 wrote:

What I think is pretty awesome is that some guys created games, raycasters, simulations, in javascript. Here's the raycaster.

Anyone else use javascript?

That's really cool! I've been forcing myself to learn Javascript lately, but I'm much more of a Java fan.  tongue

Offline

 

#6 2012-06-04 10:18:49

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Javascript topic

bump

Offline

 

#7 2012-06-04 10:48:01

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Javascript topic


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#8 2012-06-04 21:58:36

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Javascript topic

SciTecCf wrote:

Platformer in JS.

I looked at that and found that w3schools covers the very basics of the syntax. I got more learning to do...

Offline

 

#9 2012-06-04 22:00:59

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Javascript topic

Javascript confuses me. Why can't it be more like PHP?

I mean document.something.write()? Shouldn't that be write() or write " " ?


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#10 2012-06-04 22:06:47

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Javascript topic

jji7skyline wrote:

Javascript confuses me. Why can't it be more like PHP?

I mean document.something.write()? Shouldn't that be write() or write " " ?

But it's a function of the document.


Posts: 20000 - Show all posts

Offline

 

#11 2012-06-04 22:08:03

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Javascript topic

veggieman001 wrote:

jji7skyline wrote:

Javascript confuses me. Why can't it be more like PHP?

I mean document.something.write()? Shouldn't that be write() or write " " ?

But it's a function of the document.

But all the functions are like that. Just plain confusing in my opinion. Ruby is such a good syntax, it should be implemented more  hmm


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#12 2012-06-04 22:09:43

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Javascript topic

jji7skyline wrote:

veggieman001 wrote:

jji7skyline wrote:

Javascript confuses me. Why can't it be more like PHP?

I mean document.something.write()? Shouldn't that be write() or write " " ?

But it's a function of the document.

But all the functions are like that. Just plain confusing in my opinion. Ruby is such a good syntax, it should be implemented more  hmm

Well, it makes sense that they'd be like that because they're all functions of the document, which is an object. Don'tcha know object-oriented programming?


Posts: 20000 - Show all posts

Offline

 

#13 2012-06-04 22:11:37

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Javascript topic

Well, function based programming calls functions like

mail()

Whereas object based programming calls objects, I don't know how though  tongue


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#14 2012-06-04 22:29:35

alldaykade28471
Scratcher
Registered: 2011-05-25
Posts: 1000+

Re: Javascript topic

Does anyone know a free website hoting company that uses javascript?

Offline

 

#15 2012-06-04 22:30:44

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Javascript topic

alldaykade28471 wrote:

Does anyone know a free website hoting company that uses javascript?

All webhosting companies have javascript enabled.

Try 1freehosting.


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#16 2012-06-04 22:40:42

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Javascript topic

jji7skyline wrote:

Well, function based programming calls functions like

mail()

Whereas object based programming calls objects, I don't know how though  tongue

Well, classes can have functions. You call the function of the class (statically) or of an object (an instance of the class), which then performs that function.

I assume it's a little different in JS, but the same concept stands.

Last edited by veggieman001 (2012-06-04 22:41:28)


Posts: 20000 - Show all posts

Offline

 

#17 2012-06-05 04:00:53

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Javascript topic

SciTecCf wrote:

Platformer in JS.

That's good.


http://trinary.tk/images/signature_.php

Offline

 

#18 2012-06-05 04:20:56

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Javascript topic

trinary wrote:

SciTecCf wrote:

Platformer in JS.

That's good.

It is, actually.


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#19 2012-06-05 06:17:50

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Javascript topic

XenoK and I are building a Scratch 2.0 player and editor in JavaScript.

Last edited by bobbybee (2012-06-05 06:18:07)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#20 2012-06-05 06:20:11

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Javascript topic

bobbybee wrote:

XenoK and I are building a Scratch 2.0 player and editor in JavaScript.

Cool! Can't wait to try it!


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#21 2012-06-05 06:22:02

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Javascript topic

SciTecCf wrote:

bobbybee wrote:

XenoK and I are building a Scratch 2.0 player and editor in JavaScript.

Cool! Can't wait to try it!

I hope it's fast.

And iOS devices would be able to play it too! That would be awesome!  big_smile

Even android phones  smile


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#22 2012-06-05 07:41:13

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Javascript topic

bobbybee wrote:

XenoK and I are building a Scratch 2.0 player and editor in JavaScript.

Sweet  smile


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#23 2012-06-05 09:32:08

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Javascript topic

SciTecCf wrote:

Platformer in JS.

:o

alldaykade28471 wrote:

Does anyone know a free website hoting company that uses javascript?

All hosting companies use JavaScript, you need to program it yourself though. I'd recommend either 1freehosting or 000webhost. I prefer 1FH though.


Why

Offline

 

#24 2012-06-05 09:32:57

slinger
Scratcher
Registered: 2011-06-21
Posts: 1000+

Re: Javascript topic

alldaykade28471 wrote:

Does anyone know a free website hoting company that uses javascript?

Just use dropbox for testing and stuff  tongue


http://s0.bcbits.com/img/buttons/bandcamp_130x27_blue.png

Offline

 

#25 2012-06-05 09:45:17

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Javascript topic

jji7skyline wrote:

SciTecCf wrote:

bobbybee wrote:

XenoK and I are building a Scratch 2.0 player and editor in JavaScript.

Cool! Can't wait to try it!

I hope it's fast.

And iOS devices would be able to play it too! That would be awesome!  big_smile

Even android phones  smile

Another HTML5 player that's being made makes it so I can actually play Rhy's projects.


Posts: 20000 - Show all posts

Offline

 

Board footer