04-04-2006, 11:43 PM | #21 |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Remember, you can use document.write() to echo straight html too (think about using that to build a table? )
|
04-04-2006, 11:44 PM | #22 |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
Look at the code I posted above. That's the most advanced thing he has taught us so far.
|
04-04-2006, 11:45 PM | #23 |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
Yeah, but the stuff you guys are showing me is stuff we haven't learned, so...........arghhhhhhhhh I quit!
|
04-04-2006, 11:45 PM | #24 | |
Homer of Kittens
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
|
Quote:
__________________
-------------------------------------------------- Games I am playing: Jeanne D'Ark (PSP) Firefox rules |
|
04-04-2006, 11:46 PM | #25 |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
Yes.
|
04-04-2006, 11:50 PM | #26 |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Well, if your textbook talks about loops, then hasn't he taught it to you in some way by assigning you that reading? All I'm talking about here is basic math and one loop.
"Using the programming techniques you learned in this chapter..." What's the topic of the chapter? |
04-04-2006, 11:50 PM | #27 |
Homer of Kittens
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
|
Good. document.writeln() is a function that writes HTML to the page directly. So if you say
document.writeln("<H1> My name is SakSquash</H1>") it is the same as like you are writing that in HTML. Just pass the HTML of the table into the document.writeln function. document.writeln("<TABLE>"); document.writeln("<TR>"); document.writeln("<TD>"); .... ... document.writeln("/TABLE");
__________________
-------------------------------------------------- Games I am playing: Jeanne D'Ark (PSP) Firefox rules |
04-04-2006, 11:53 PM | #28 | |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
Quote:
|
|
04-04-2006, 11:53 PM | #29 | |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Quote:
Hint: Code:
document.write(Math.pow(0,2)); document.write(Math.pow(0,3)); |
|
04-04-2006, 11:56 PM | #30 |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
But we haven't learned math.pow.
|
04-04-2006, 11:57 PM | #31 | |
Homer of Kittens
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
|
Quote:
var i; var square; var cube; i = 0 square = i*i; cube = i*i*i; document.writeln(i); i=1; .... It's much preferable to use a loop though because you are basically repeating the same thing 11 times.
__________________
-------------------------------------------------- Games I am playing: Jeanne D'Ark (PSP) Firefox rules |
|
04-04-2006, 11:57 PM | #32 | |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Quote:
Code:
document.write(number * number); document.write(number * number * number); |
|
04-04-2006, 11:58 PM | #33 | |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Quote:
|
|
04-04-2006, 11:59 PM | #34 | |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
Quote:
|
|
04-05-2006, 12:00 AM | #35 | |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Quote:
Look... learning this is actually worthwhile. You can do some pretty amazing things with Javascript, but you've got to learn how it works or it's all just pointless. |
|
04-05-2006, 12:01 AM | #36 | |
Homer of Kittens
Join Date: Aug 2004
Location: San Francisco, Bay Area
Posts: 4,374
|
Quote:
__________________
-------------------------------------------------- Games I am playing: Jeanne D'Ark (PSP) Firefox rules |
|
04-05-2006, 12:03 AM | #37 | |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Quote:
|
|
04-05-2006, 12:07 AM | #38 |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
Eh, whatever. I'm just going to do it without the formula.
|
04-05-2006, 12:12 AM | #39 | |
Friendly Server Admin
Join Date: Sep 2003
Location: Marin County, CA
Posts: 4,087
|
Quote:
|
|
04-05-2006, 12:13 AM | #40 |
Banned User
Join Date: Nov 2004
Location: New Paltz...for now...
Posts: 6,177
|
Well, I don't see anything that says I HAVE to use a formula. I can just make a table!
|
Thread Tools | |
|