[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

addeventlistener quirks

Andrew Poulos

1/24/2015 6:09:00 AM

The code I've been working on uses addEventListener. The elearning
course I've been building is written in valid HTML5. The client's
Learning Management System (LMS) wraps my course's window in a window of
its own. The LMS seems to "force" IE to render the course in quirks
mode. In quirks mode IE9 gives an error that addEventListener is
unsupported.

Is the only option to use attachEvent?

Andrew Poulos
4 Answers

Andrew Poulos

1/24/2015 6:15:00 AM

0

On 24/01/2015 5:08 PM, Andrew Poulos wrote:
> The code I've been working on uses addEventListener. The elearning
> course I've been building is written in valid HTML5. The client's
> Learning Management System (LMS) wraps my course's window in a window of
> its own. The LMS seems to "force" IE to render the course in quirks
> mode. In quirks mode IE9 gives an error that addEventListener is
> unsupported.
>
> Is the only option to use attachEvent?

No, it doesn't matter now :-(

In quirks mode IE won't recognise "new Audio()". Without it the rest is
moot.

Andrew Poulos

Christoph M. Becker

1/24/2015 5:32:00 PM

0

Andrew Poulos wrote:

> The code I've been working on uses addEventListener. The elearning
> course I've been building is written in valid HTML5. The client's
> Learning Management System (LMS) wraps my course's window in a window of
> its own. The LMS seems to "force" IE to render the course in quirks
> mode. In quirks mode IE9 gives an error that addEventListener is
> unsupported.

It seems that IE 11 in IE 9 emulation mode does define the
`addEventListener` property of window and elements, as the following
console session for a document without doctype demonstrates:

> document.compatMode
=> "CSS1Compat"
> window.addEventListener
=> function addEventListener() { [native code] }
> document.body.addEventListener
=> function addEventListener() { [native code] }

Are you sure there is no X-UA-Compatible in place (either HTTP header or
meta element)?

What do you mean with "wraps my course's window in a window of its own"?
An Iframe?

--
Christoph M. Becker

Thomas 'PointedEars' Lahn

1/25/2015 1:29:00 AM

0

Christoph M. Becker wrote:

> Andrew Poulos wrote:
>> The code I've been working on uses addEventListener. The elearning
>> course I've been building is written in valid HTML5. The client's
>> Learning Management System (LMS) wraps my course's window in a window of
>> its own. The LMS seems to "force" IE to render the course in quirks
>> mode. In quirks mode IE9 gives an error that addEventListener is
>> unsupported.
>
> It seems that IE 11 in IE 9 emulation mode does define the
> `addEventListener` property of window and elements,

<http://ie.microsoft.com/testdrive/ieblog/2011/Mar/24_IE9sDocumentModesandJavaScript...

â??Quirks modeâ? is not the same as â??IE 9 standardsâ? Document Mode, and
certainly IE 11 in â??IE 9 standardsâ? Document Mode is not the same as IE 9 in
â??Quirks modeâ?.

IE 9 in â??Quirks modeâ? is lower in regard to standards compliance than â??IE 7
standards� Document Mode. addEventListener() certainly is not available
there.

One should never rely on that a document only renders correctly when in
â??Quirks modeâ?.


The light at the end of the tunnel is that there are rumors that Microsoft
is going to replace Internet Explorer in favor of a lightweight rewrite
codenamed â??Spartanâ?. It remains to be seen if this comes true and if the
result will be in any way more pleasing than what we have today:

<http://www.zdnet.com/article/microsoft-is-building-a-new-browser-as-part-of-its-windows-10...

This fits well with official information that support for IE 8 will be
discontinued, and for IE 9 and 10 reduced, starting next year:

<http://www.techradar.com/news/internet/web/abandon-ship-microsoft-will-kill-support-for-internet-explorer-8-in-2016-1...

--
PointedEars
FAQ: <http://PointedEars.... | SVN: <http://PointedEars.de...
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-...
Please do not cc me. / Bitte keine Kopien per E-Mail.

Christoph M. Becker

1/25/2015 2:17:00 PM

0

Thomas 'PointedEars' Lahn wrote:

> Christoph M. Becker wrote:
>
>> It seems that IE 11 in IE 9 emulation mode does define the
>> `addEventListener` property of window and elements,
>
> <http://ie.microsoft.com/testdrive/ieblog/2011/Mar/24_IE9sDocumentModesandJavaScript...
>
> â??Quirks modeâ? is not the same as â??IE 9 standardsâ? Document Mode, and
> certainly IE 11 in â??IE 9 standardsâ? Document Mode is not the same as IE 9 in
> â??Quirks modeâ?.
>
> IE 9 in â??Quirks modeâ? is lower in regard to standards compliance than â??IE 7
> standards� Document Mode. addEventListener() certainly is not available
> there.

Of course, you're right. I was confused about the value of
document.compatMode, which I thought would be "CSS1Compat" for quirks
mode, while actually it is "BackCompat". However, as I've just learned[1]:

| As of Internet Explorer 10, quirks mode behaves differently than it
| did in earlier versions of the browser. In Windows Internet Explorer
| 9 and earlier versions, quirks mode restricted the webpage to the
| features supported by Microsoft Internet Explorer 5.5. In Internet
| Explorer 10, quirks mode conforms to the differences specified in the
| HTML5 specification.

> This fits well with official information that support for IE 8 will be
> discontinued, and for IE 9 and 10 reduced, starting next year:

I'm afraid that IE 8 will stay in widespread use as long as Windows XP does.

[1] <https://msdn.microsoft.com/en-us/librar...(v=vs.85).aspx>

--
Christoph M. Becker