File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes i need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "i need help" Watch "i need help" New topic
Author

i need help

q8ygirl
Greenhorn

Joined: Jul 08, 2001
Posts: 3
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

Joined: Dec 16, 2000
Posts: 625
Which code are you talking about exactly?
q8ygirl
Greenhorn

Joined: Jul 08, 2001
Posts: 3
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

Joined: Jul 08, 2001
Posts: 3
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

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Jan 07, 1999
Posts: 6920
"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?)


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i need help