Re: Best Performance Javascript on IE6 for finding top and left using offsetTop and offsetLeft



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 implied
globals (the alert one is troubling).
What is troubling about using alert?

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.
.



Relevant Pages

  • Re: Newbie Qs: references, scopes, overwrites
    ... from the window after appending the file". ... I am not familiar with SVG, but will try and give you some pointers regarding your questions below. ... Received commands can range from "display a view which you will build using this HTML", to "here's an image, use it as a reference when building the current view", or "here comes a .stuff file, do something about it". ... What's important here is that the browser maintains a view with which the user can interact. ...
    (comp.lang.javascript)
  • Re: Qualifying method calls
    ... (or even some older browser in which `window.alert` is implemented). ... Regardless specific implementation of `window` host object will you ... `alert` will throw a Reference Error? ... From what I can see, both Rhino and V8, for example, lack global `window`. ...
    (comp.lang.javascript)
  • Re: do while help please.....
    ... I'll reference to it in other similar cases. ... it should be property of the `window' host object ... but not the property of the global object, ... To use `window.alert' or `alert' - everyone chooses, ...
    (comp.lang.javascript)
  • Re: Microsoft Cleanliness
    ... browser and properties and all that. ... each browser document had to open a new window. ... Well, with larger screens, you have a larger task bar area, and you *can* ... And requires an FSO reference. ...
    (comp.databases.ms-access)
  • Re: Microsoft Cleanliness
    ... browser and properties and all that. ... the database window is sufficient object browser and the ... closing it, re-opening the previous app. ... And requires an FSO reference. ...
    (comp.databases.ms-access)