This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

i need help

 
q8ygirl
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi can any one help me with this code
i need to know what each line does exactly
< script language="JavaScript">

window.setTimeout("timer()",1000,"JavaScript")

function timer()

{

var s = document.all.item("jumpTime").innerText;

/* alert(s); */

var time = (s);

time = time - 1;

document.all.item("jumpTime").innerText = time;

if (time > 0) {

window.setTimeout("timer()",1000,"JavaScript");

}

}

< /script>
(edited by Cindy to add spaces so that it will not execute)
[This message has been edited by Cindy Glass (edited July 09, 2001).]
 
Sean Casey
Ranch Hand
Posts: 625
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which code are you talking about exactly?
 
q8ygirl
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry for that, here is the code
< script language="JavaScript">

window.setTimeout("timer()",1000,"JavaScript")

function timer()

{

var s = document.all.item("jumpTime").innerText;

/* alert(s); */

var time = (s);

time = time - 1;

document.all.item("jumpTime").innerText = time;

if (time > 0) {

window.setTimeout("timer()",1000,"JavaScript");

}

}

< /script>
[This message has been edited by Cindy Glass (edited July 09, 2001).]
 
q8ygirl
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i posted the code but it dosent show here why???
< textarea name="S1" rows="10" cols="40">< script language="JavaScript">
< br>
window.setTimeout("timer()",1000,"JavaScript"
< br>
function timer()
< br>
{
< br>
var s = document.all.item("jumpTime" .innerText;
< br>
/* alert(s); */
< br>
var time = (s);
< br>
time = time - 1;
< br>
document.all.item("jumpTime" .innerText = time;
< br>
if (time > 0) {
< br>
window.setTimeout("timer()",1000,"JavaScript" ;
< br>
}
< br>
}
< br>
< /script>
(edited by Cindy to put spaces in JavaScript so that it would not execute)

[This message has been edited by Cindy Glass (edited July 09, 2001).]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, in no time at all someone is going to come along and tell you that your name doesn't conform to the JavaRanch naming policy. Look out for the 'Tony Alicea' bot
The code you pasted is Javascript and not Java. If you asked in the http://www.javaranch.com/cgi-bin/ubb/forumdisplay.cgi?action=topics&forum=HTML+and+JavaScript&number=20&DaysPrune= HTML and Javascript forum you'd have better luck.
The reason your code didn't show up was because it was Javascript. When the browser tries to show it it tries to show it as javascript code (ie execute the code) rather than doing what you expected, which was printing it on the screen.
Dave.
(damn ubb code )
[This message has been edited by David O'Meara (edited July 08, 2001).]
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"q8ygirl",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
(I'm not Tony, but will any Sheriff do?)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic