Click here to Skip to main content
15,925,602 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: reloading pages from other windows Pin
Karthik. A4-Oct-10 10:41
Karthik. A4-Oct-10 10:41 
AnswerRe: reloading pages from other windows Pin
Gerben Jongerius6-Oct-10 3:15
Gerben Jongerius6-Oct-10 3:15 
QuestionHTTPs Headers Pin
wenlong883-Oct-10 23:40
wenlong883-Oct-10 23:40 
AnswerRe: HTTPs Headers Pin
Richard MacCutchan4-Oct-10 0:53
mveRichard MacCutchan4-Oct-10 0:53 
QuestionHow to read the body of methods in JavaScript Pin
sainath4373-Oct-10 19:20
sainath4373-Oct-10 19:20 
GeneralRe: How to read the body of methods in JavaScript Pin
Sunasara Imdadhusen4-Oct-10 2:45
professionalSunasara Imdadhusen4-Oct-10 2:45 
AnswerRe: How to read the body of methods in JavaScript Pin
Karthik. A4-Oct-10 10:18
Karthik. A4-Oct-10 10:18 
AnswerRe: How to read the body of methods in JavaScript Pin
moocr.com1-Nov-10 15:58
moocr.com1-Nov-10 15:58 
QuestionCalling jar file from javascript at client side Pin
sakthii3-Oct-10 4:20
sakthii3-Oct-10 4:20 
AnswerRe: Calling jar file from javascript at client side Pin
moocr.com1-Nov-10 16:01
moocr.com1-Nov-10 16:01 
GeneralRe: Calling jar file from javascript at client side Pin
sakthii25-Nov-10 2:58
sakthii25-Nov-10 2:58 
QuestionJavascript/ASP/SQL Pin
Paul Hayman2-Oct-10 20:59
Paul Hayman2-Oct-10 20:59 
AnswerRe: Javascript/ASP/SQL Pin
NeverHeardOfMe3-Oct-10 4:41
NeverHeardOfMe3-Oct-10 4:41 
GeneralRe: Javascript/ASP/SQL Pin
Paul Hayman3-Oct-10 5:22
Paul Hayman3-Oct-10 5:22 
GeneralRe: Javascript/ASP/SQL (edit) Pin
NeverHeardOfMe3-Oct-10 5:42
NeverHeardOfMe3-Oct-10 5:42 
GeneralHere's a bit of old code I dug up... Pin
NeverHeardOfMe3-Oct-10 5:59
NeverHeardOfMe3-Oct-10 5:59 
GeneralRe: Here's a bit of old code I dug up... Pin
Paul Hayman3-Oct-10 8:01
Paul Hayman3-Oct-10 8:01 
GeneralRe: Here's a bit of old code I dug up... Pin
NeverHeardOfMe3-Oct-10 10:34
NeverHeardOfMe3-Oct-10 10:34 
Questionfind the mistake Pin
yumss1-Oct-10 1:22
yumss1-Oct-10 1:22 
AnswerRe: find the mistake Pin
Pete O'Hanlon1-Oct-10 1:46
mvePete O'Hanlon1-Oct-10 1:46 
GeneralRe: find the mistake Pin
NeverHeardOfMe1-Oct-10 3:20
NeverHeardOfMe1-Oct-10 3:20 
AnswerRe: find the mistake Pin
Stryder_11-Oct-10 3:25
Stryder_11-Oct-10 3:25 
AnswerRe: find the mistake Pin
W Balboos, GHB6-Oct-10 10:02
W Balboos, GHB6-Oct-10 10:02 
Since you've already gotten some answers, I'll just point out a few items that may improve your coding. These are general solutions - the can be language and implementation specific.

For conversion to %, you'd (potentially) improve your accuracy by multiplying by 100 before dividing by 500. This is true if the math is done as integer math. The first division, by 500, will truncate values, which, when you multiply them, will be lost data. Although this is negligible in the this exact case, it can cause problems when the calculations aren't quite so clean. It is often the case (for floating point calcs) that multiplication by 0.1 is faster than division by 10.0.

Your many write() statements could be, perhaps, changed to assignments to a string, with only a single print statement. You could take it a step further and even simply assign a single letter to the string and use a formatted write() statement. Assignments are usually easier to understand (and have less internal overhead) than function calls. Again, you code is simple, but this could become a consideration as you create more complex apps. This also might be a matter of taste.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010

Questionbrowser display problem Pin
annie_bel29-Sep-10 23:32
annie_bel29-Sep-10 23:32 
AnswerRe: browser display problem Pin
Gerben Jongerius30-Sep-10 2:24
Gerben Jongerius30-Sep-10 2:24 

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.