Sean said:
The library has several 'transport stacks', one that uses postMessage,
one that uses window.name and one that uses FIM.
Yes, I am familiar with such stacks. Dojo has something similar (which
is not a ringing endorsement).
Most users that are stuck with IE6/7 are either unaware/incompetent,
or are unable to upgrade to a different browser.
I'd be very careful of projecting incompetence onto your users. Users
don't need to know much of anything. Any design that assumes they know
more than how to use the basic features of the browser (or that they
even know what a browser is) is folly. And I don't follow what you are
saying about upgrading. Are you assuming that IE6/7 users will never
upgrade (or be upgraded?)
Most users that are using other browsers are aware/competent and are
able to upgrade to modern versions,
all supporting the postMessage stack.
That's a very _broad_ assumption. You should not design based on such
assumptions.
Also, most older browsers work similarly when it comes to the how the
name property is persisted across navigation, etc.
Most? Similarly? It sounds as if you have settled on a design that
sort of seems to work and will defend it to the end. That's not sound
browser scripting practice either.
Nope, cause that code doesn't change the behavior in any way, nor is
it 'wrong' in any way. Just unnecessary.
Due to unfortunate snipping in this thread, it is hard to tell what code
you are referring to.
[Sean Kinsey wrote:]
A useless comment as my expectations are based on observable facts
Programming by observation is the wrong approach. How many
configurations does one version of IE have? For instance, for _years_,
jQuery blew up immediately when ActiveX was disabled. Why? Resig had
never _seen_ a grin without a cat.
That is true. But observation is the only way to verify compliance.
And to be honest, I'd rather be the author of a library that works
(even if it 'misuses' the Fragment Identifier),
then one that doesn't (but follows every spec).
See previous comment. Which of the umpteen million configurations of IE
do you consider relevant?
Most of the default ones.
Oops. What makes you think that everyone uses IE in its default
configuration. Certainly many corporate users (for example) do not.
And no, I dont' count 'javascript disabled' etc as one of those. My
library cannot perform magic so why try.
Then you have only umpteen million minus one configurations to consider.
And make sure your _site_ does perform "magic" as many corporate
users, blind people, etc. disable JS (or have it disabled for them).
Why are you all busting my balls, pinpointing 'errors' etc. without
actually offering a 'better' way?
I can only speak for myself. You asked for feedback and you got it. I
haven't had a chance to go through all of your script, but the first
thing I noticed was an object inference based on attachEvent with an
unsafe host object property test and an explanation that didn't match up
with reality. Thomas has pointed that out, as well as other problems.
It's up to you to take (or leave) the advice. And get used to the
reality that there may not be better way for what you have decided to
do. That's why it pays to consider the relevant cross-browser
abstractions at the design stage. Observations should be used only
after the development to confirm (as best they can) that your design is
sound.
Why are you advocating that my code is 'wrong' when it uses the FIM or
window.name, when there is in fact no other
way to achieve cross-domain messaging (that is, in the browsers where
the use of these methods are necessary).
Aha!