Click here to Skip to main content
16,008,469 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: HTTP File upload Pin
alex.barylski10-Oct-05 8:01
alex.barylski10-Oct-05 8:01 
QuestionList User Domains using GetObject Pin
drhanes10-Oct-05 5:25
drhanes10-Oct-05 5:25 
QuestionDIV Alignment and Spaces Pin
Brendan Vogt9-Oct-05 22:02
Brendan Vogt9-Oct-05 22:02 
AnswerRe: DIV Alignment and Spaces Pin
Guffa9-Oct-05 22:59
Guffa9-Oct-05 22:59 
QuestionIE toolbars' positioning problem Pin
Hans Ruck9-Oct-05 21:07
Hans Ruck9-Oct-05 21:07 
QuestionJavascript problem, please help Pin
Tesic Goran9-Oct-05 9:33
professionalTesic Goran9-Oct-05 9:33 
AnswerRe: Javascript problem, please help Pin
Edbert P13-Oct-05 18:00
Edbert P13-Oct-05 18:00 
QuestionClearing the Screen Pin
moggers697-Oct-05 17:35
moggers697-Oct-05 17:35 
Hi All,
I JUST starting in JS, so pardon my obvious ignorance. I have a little CBM experience, so some of the code structure may look a little funky.
I am trying to clear the screen in a very simple script, but so far all of my research has not found a "native" method.
Is it even possible under JS?
I have tried several methods from various sites, none of which manage to clear the screen ready for the next set of entries.
This IS a problem set by my TAFE tutors, but what I am trying to do is beyond what they have asked for. The program is complete, I just thought it would be nicer to clear the screen if the confirm loop is repeated, instead of scrolling down the page after each operation.

My Code is as follows:

<b><html>
<head>
<title> problem 13 </title>

</head>
<body bgcolor=silver>

<script language=JavaScript>
var mark=0, student=" ", total=0, level=0, avg=0, again=1;

var grade=[[49,"FAIL"],[59,"PASS"],[69,"CREDIT"],[70,"DISTINCTION"],[83,"HIGH DISTINCTION"],[100,"TOP"]];

mess1="Student Name:";
mess2="Marks in Subject ";
mess3="<u>Total Marks</u>: ";
mess4="<u>Average</u>: ";
mess5="<u>Grade</u>: ";

var show0="</b></font>";
var show1="<font color=red><b>";
var show2="<font color=black><b>";
var show3="<font color=purple><b>";
var show4="<font color=blue><b>";
var show5="<font color=green><b>";

while (again>=1) {
var mark=0, student="Student", total=0, level=0, avg=0;

document.write("<font face=times><center><h1>Problem 13</h1><hr size=7 width=50%></hr><font face=arial>") ;

student=prompt(mess1,"Student");
document.write("<table><tr><td width=200>"+mess1+"</td><td>"+student+"</td><tr>")

for ( x=1; x<=6; x++ ) {
mark=prompt(mess2+x,0);
total=parseInt(total)+parseInt(mark)
document.write("<td><b>"+mess2+"</b>"+x+": </td><td>"+mark+"</td><tr>")
}
avg=parseInt((total/6)*100)/100

document.write("<td>"+mess3+"</td><td>"+total+"</td>")
document.write("<tr><td>"+mess4+"</td><td>"+avg+"</td>")
document.write("<tr><td>"+mess5+"</td><td width=200>")

if (avg<=100&&avg>=83) { document.write(show5+grade[4] [1]+show0) }
if (avg<=82&&avg>=71) { document.write(show4+grade[3] [1]+show0) }
if (avg<=70&&avg>=61) { document.write(show3+grade[2] [1]+show0) }
if (avg<=60&&avg>=50) { document.write(show2+grade[1] [1]+show0) }
if (avg<=49&&avg>=0) { document.write(show1+grade[0] [1]+show0) }

document.write("</td></table><br>")

again=confirm("Enter Another Students Details?");
}

</script><p>
THANK YOU!
</center></font>
</body>
</html></b>

Thanks, Moggers69

I'm new here, so please forgive my ignorance.
GeneralRe: Clearing the Screen Pin
Guffa8-Oct-05 1:03
Guffa8-Oct-05 1:03 
AnswerRe: Clearing the Screen Pin
moggers698-Oct-05 16:35
moggers698-Oct-05 16:35 
GeneralRe: Clearing the Screen Pin
moggers698-Oct-05 18:37
moggers698-Oct-05 18:37 
GeneralRe: Clearing the Screen Pin
Guffa9-Oct-05 2:04
Guffa9-Oct-05 2:04 
AnswerRe: Clearing the Screen Pin
moggers6912-Oct-05 17:28
moggers6912-Oct-05 17:28 
AnswerRe: Clearing the Screen Pin
T1TAN11-Oct-05 2:47
T1TAN11-Oct-05 2:47 
AnswerRe: Clearing the Screen Pin
moggers6912-Oct-05 17:25
moggers6912-Oct-05 17:25 
GeneralRe: Clearing the Screen Pin
T1TAN12-Oct-05 20:56
T1TAN12-Oct-05 20:56 
AnswerTHANKS 2 ALL Pin
moggers6920-Oct-05 1:30
moggers6920-Oct-05 1:30 
QuestionHow to Highlight the items in listbox in javascript? Pin
bin_bin17-Oct-05 9:04
bin_bin17-Oct-05 9:04 
QuestionError using the Web Site Administration Tool Pin
Anonymous7-Oct-05 7:03
Anonymous7-Oct-05 7:03 
QuestionUnable to script library Pin
Chiari6-Oct-05 17:56
Chiari6-Oct-05 17:56 
AnswerRe: Unable to script library Pin
Gavin Jeffrey6-Oct-05 22:40
Gavin Jeffrey6-Oct-05 22:40 
GeneralRe: Unable to script library Pin
Chiari9-Oct-05 15:17
Chiari9-Oct-05 15:17 
QuestionSession time out Pin
Chiari6-Oct-05 17:14
Chiari6-Oct-05 17:14 
AnswerRe: Session time out Pin
Gavin Jeffrey6-Oct-05 23:36
Gavin Jeffrey6-Oct-05 23:36 
GeneralRe: Session time out Pin
Guffa8-Oct-05 1:16
Guffa8-Oct-05 1:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.