Java Questions
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jimmy_Dillinger
Posted On:   Thursday, February 20, 2003 12:54 PM

I am learning javascript and have a couple questions.
What do the diffrent colors mean in the J++ HTML editor, like the green, red, blue?
I know you can not have 2 onLoad events in the body of the HTML program but if I want 2 things done when the loading of the page occurs how di I do this?
One last question. how would I write an if/else that would print a statement indicating whether someone passed or failed based on a 60 as a passing grade.

Thank you for your help.


Please use html tags to format code blocks.

Re: Java Questions

Posted By:   Nitesh_Naveen  
Posted On:   Friday, February 21, 2003 02:35 AM

1. The coloring scheme varies a bit from editor to editor, but commonly i guess blue indicates statements and conditions, green indicates javascript objects etc and red indicates functions and probably html objects etc. You can edit this coloring scheme as per your preferences too!!!


2. To do/call more than one thing/function you can write all those within the onload function. Alternatively and more cleanly, you can call a function in the onload and do whatever in that function.


3. The question is not very clear here!!! you just want to write in inline or want to write it dynamically say on click of a button or something? For writing inline use
if(score>60)
document.write("Congrats!!! You have passed with a score of "+score);
else
document.write("Sorry... Your score of "+score+" doesnot qualify you.");
(needless to say... this should be inside the body tag and withing scripts tag).
About | Sitemap | Contact