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.
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
SciTecCf wrote:
I suck at JS. I can only write short scriplets such as "onClick".
Still, thanks to your madlib, I now know what innerHTML does.
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
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.
Offline
Offline
SciTecCf wrote:
I looked at that and found that w3schools covers the very basics of the syntax. I got more learning to do...
Offline
Javascript confuses me. Why can't it be more like PHP?
I mean document.something.write()? Shouldn't that be write() or write " " ?
Offline
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.
Offline
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
Offline
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
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?
Offline
Well, function based programming calls functions like
mail()
Whereas object based programming calls objects, I don't know how though
Offline
Does anyone know a free website hoting company that uses javascript?
Offline
alldaykade28471 wrote:
Does anyone know a free website hoting company that uses javascript?
All webhosting companies have javascript enabled.
Try 1freehosting.
Offline
jji7skyline wrote:
Well, function based programming calls functions like
mail()
Whereas object based programming calls objects, I don't know how though
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)
Offline
Offline
Offline
XenoK and I are building a Scratch 2.0 player and editor in JavaScript.
Last edited by bobbybee (2012-06-05 06:18:07)
Offline
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!
Even android phones
Offline
SciTecCf wrote:
: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.
Offline
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!
Even android phones
Another HTML5 player that's being made makes it so I can actually play Rhy's projects.
Offline