hogtied
03-08-2003, 06:24 AM
Hey,
I was wondering would it be better, whether for performance or whatever to run a statement all the time or encase it in an if statement.
for example:
document.form1.options[thisDate].selectedIndex = true;
lets say that the above statement is within a function, and that function is called upon every time a user changes either the month or date of both arrival and/or departure dates. The only instatance that this statement would not have to be read by the computer is if the user selected the date.
it will also work the same if i wrote it this way:
if (object != date) {
document.form1. etc.. etc..
}
Would I benifit anything from doing this. Such as less calculations, faster response, etc. etc,, anything...
Just curious
Thanks
Hogtied
I was wondering would it be better, whether for performance or whatever to run a statement all the time or encase it in an if statement.
for example:
document.form1.options[thisDate].selectedIndex = true;
lets say that the above statement is within a function, and that function is called upon every time a user changes either the month or date of both arrival and/or departure dates. The only instatance that this statement would not have to be read by the computer is if the user selected the date.
it will also work the same if i wrote it this way:
if (object != date) {
document.form1. etc.. etc..
}
Would I benifit anything from doing this. Such as less calculations, faster response, etc. etc,, anything...
Just curious
Thanks
Hogtied