Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Javascript
hiding javascript function call from status bar.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="David Mark, post: 4981051"] Yes. In IE typeof returns "object" for host methods, rather than "function." Could be. Well, you should always do a feature check and exit. Why let the script get going and then crash unexpectedly. It might half- initialize the enhancement, leaving the document unusable. This goes for any host method. That's why you should degrade gracefully, which requires a "gateway" that detects/tests all of the needed features. And they are all wrong. Millions of pages branch based on navigator.userAgent too. Try this: if (window.external.addFavorite) Why? Because that particular host object is finicky. It may be that it is an ActiveX object underneath, but only MS knows for sure. The typeof test predictably yields "unknown." Then there is the offsetParent example I posted a month or so back. Similar inexplicable error (different message) unless typeof is used to detect the "unknown" property. So it isn't just methods. There was a time when IE7 would throw exceptions on type converting the href property of news links (rendering the property useless.) It seems they fixed that at some point. Of course, MS can change the rules at any time via Windows Update or new versions of IE. If they decide to make document an ActiveX object under the hood, then gEBI and the rest would be "unknown" types. Even such an extreme (and unlikely) eventuality would not cause a single hiccup with isHostMethod. All of those other scripts would explode on takeoff. Same, but considered slightly less harmful as 'all' is not a function (despite the fact that you can call it.) Except this is IE, so we have no choice. Unless it is IE. See the offsetParent example. I'm not saying it is an everyday occurence (offsetParent is usually safe to evaluate), but under some circumstances it can throw an exception. You mean intrinsic event handlers? I don't remember what is involved with attaching listeners in NN4. And what is "/nolink" supposed to be? And is this not generated by script? I don't know what that means. How so for NN4? And certainly IE supported onclick and the rest on virtually anything. [snip] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Javascript
hiding javascript function call from status bar.
Top