R
Randy Webb
(e-mail address removed) said the following on 6/6/2006 2:01 PM:
Think about what you are saying.
Dot Notation is a shortcut for Bracket Notation.
Use the shortcut instead of the brackets until the shortcut doesn't work
and then use the brackets.
Do you also think it would be a good idea to use a shortcut in IE until
it doesn't work elsewhere?
<div id="myDiv"></div>
myDiv.innerHTML = "something new";
"works" (loosely worded) in IE. So, do you use the shortcut until it
doesn't work or do you just use a reliable fool proof way all the time
and not worry about it?
If you want fool proof and reliability, you use Brackets. But as has
been pointed out - many times already - there is no blanket 100% answer
to that question. It has a lot to do with personal preference.
Matt Kruse wrote:
I would think the best practice would be "only use bracket notation
when dot notation will not work."
Think about what you are saying.
Dot Notation is a shortcut for Bracket Notation.
Use the shortcut instead of the brackets until the shortcut doesn't work
and then use the brackets.
Do you also think it would be a good idea to use a shortcut in IE until
it doesn't work elsewhere?
<div id="myDiv"></div>
myDiv.innerHTML = "something new";
"works" (loosely worded) in IE. So, do you use the shortcut until it
doesn't work or do you just use a reliable fool proof way all the time
and not worry about it?
If you want fool proof and reliability, you use Brackets. But as has
been pointed out - many times already - there is no blanket 100% answer
to that question. It has a lot to do with personal preference.