|
Posted by Anthony Levensalor on 01/10/08 04:49
* Diogenes wrote, on %m/1240588 /%y at %:%m:
> Randy Webb wrote:
>> Your anti-MS rants are just as off topic in comp.lang.javascript as
>> they are in ciwas.
>>
>> You reply and tell me what it has to do with Javascript and I will be
>> happy to debunk the many myths in your post.
>>
>
> Javascript is client side programming that will work, for the most
> part, with all modern browsers without resorting to special
> code that targets a specific browser.
>
> Exceptions to this include embedded sound and video objects and
> code that employs programming colliquisms such as 'document.all'.
>
> Over to you RANDY WEBB ... yes, the many myths? I'll be satisfied
> if you offer 3.
>
> -Dio
Myth #1:
That you have the ability to understand the basics of communication in
the English language.
Fact #1:
You were asked what this topic had to do with Javascript. You responded
by stating that Javascript runs in modern browsers. This still has
nothing to do with the topic of the thread, which is Browser Market
Share, not browser detection, or anything associated with Javascript.
Myth #2:
> Javascript is client side programming
Fact #2:
Javascript runs on both the client and the server
Myth #3:
that will work, for the most
> part, with all modern browsers without resorting to special
> code that targets a specific browser.
Fact #3:
Your myth implies that javascript requires no sort of checking to make
sure the features being used are supported in the currently running
environment. This is untrue, because object/feature/function detection
is a staple of modern Javascript coding practices, and as a technique is
a more elegant and far less error prone method for targeting a specific
browser.
Consider any function trying to get the source element of an event:
function eventHandler(e) {
// in some browsers, e will be undefined, IE is one.
// in Mozilla, e will be an event object
if (window.event) {
e = window.event;
}
var elm = e.srcElement; // IE
var elm = e.target; // Mozilla
}
There are countless other examples.
style.filter
style.opacity
Both work with the alpha opacity of an element. In IE, however, you
cannot change the opacity of an element that does not have a width and
height explicitly set.
Myth #4:
> Exceptions to this include embedded sound and video objects and
Fact #4:
Since your initial premise was incorrect, your exceptions to that
premise are also incorrect by default.
The following works in IE, FireFox, Opera, and Safari for Windows:
<embed type="application/x-mplayer2"
src="11%20My%20Friend%20Of%20Misery.mp3" autostart="false" loop="false">
With no modification. It isn't even valid markup, and it has that kind
of compatibility.
Myth #5:
> code that employs programming colliquisms such as 'document.all'. (as
another exception)
Fact #5:
document.all _is_ code that targets specific browsers. That doesn't
require a workaround or special code, it requires a basic education in
DOM standards and script bindings.
~A!
--
anthony at my pet programmer dot com
Navigation:
[Reply to this message]
|