Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: David Mark <dmark.cinsoft@xxxxxxxxx>
- Date: Mon, 28 Dec 2009 22:57:34 -0800 (PST)
On Dec 29, 1:35 am, Garrett Smith <dhtmlkitc...@xxxxxxxxx> wrote:
David Mark wrote:
On Dec 29, 12:05 am, Garrett Smith <dhtmlkitc...@xxxxxxxxx> wrote:
David Mark wrote:
On Dec 28, 9:53 pm, Garrett Smith <dhtmlkitc...@xxxxxxxxx> wrote:[...]
Thomas 'PointedEars' Lahn wrote:
moha297 wrote:
[...]
function documentClicked(ev){ }
JSLint doesn't allow that perfectly valid, easily understandable program
to pass.
Bad style. Makes it more confusing than it needs to be (for beginners
who may have to maintain it). And you can turn that one off I think.
It is fine that way; nothing really confusing about it. It is
syntactically valid, standard code for any js engine.
You know exactly what I mean.
A beginner might find it *odd* that a function could be referenced
before it appeared in source order.
Especially if they are coming to JS from another language.
A beginner might not know about
entering an execution context, what a FunctionDeclaration was, what a
FunctionExpression was, but would just notice that "it works".
A beginner would not know a lot of things, including things about
unicode support, ===, typeof, Host object.
So what?
Also, you've got an "unreachable" semi-colon and a couple of impliedWhat is troubling about using alert?
globals (the alert one is troubling).
Nothing troubling about using alert. Now, calling it unqualified in a
- finally - clause is another story.
What difference does it make if it is finally clause?
Augmented scope of course. It's best to reference alert as a method
of the window object (that's what it is after all). Then these
questions don't come up.
JSLint parses window.alert(); or alert(); as an Error. See I just don't
get that.
He wants it to be fully qualified. There are cases where that message
is helpful (e.g. generalizing functions for use with frames).
What is it that you think he wants to be fully qualified?
The window reference of course. He wants to see it referenced as a
property of an object (e.g. the Global object). As for frames,
consider this:-
e = e || window.event; // No good for elements in other frames
So that "error" in JSLint helps to spot these situations as well.
Now I can't figure out what makes that an error, yet:-
document.parentWindow.alert(1);
- is perfectly fine in JSLint. No error whatsoever. I don't get it.
That's an implied global for sure. Or perhaps you mean with "assume a
browser"? Yes, I agree that assuming a browser should allow for the
user of window (it used to).
It is odd because document is a property of the window.
In a browser (assuming a browser), the Global object has a - document
- property as well. At least, that is the underlying assumption here.
.
- Follow-Ups:
- References:
- Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: moha297
- Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: Thomas 'PointedEars' Lahn
- Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: Garrett Smith
- Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: David Mark
- Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: Garrett Smith
- Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: David Mark
- Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- From: Garrett Smith
- Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- Prev by Date: Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- Next by Date: "stanford university" "stanford business school" "stanford mba" "stanford video lectures" "stanford law school" "stanford cs" "stanford university history" "stanford medical school" ON http://stanford-edu.blogspot.com/
- Previous by thread: Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- Next by thread: Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft
- Index(es):
Relevant Pages
|