Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14635 closed bug (notabug)

Html Component Events with typeof undefined in IE11

Reported by: nicolas@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

In IE 8, 9 and 10, when you get typeof an EVENT defined by an HTC the result is the same of property linked in this manner. In IE 11 it returns "undefined", so I can't call function within.

I attach a sample of code with this behavior.

index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script src="jquery-1.10.2.js"></script>
    <script type="text/javascript">
        function onComplete() {
            alert("start");
        }
        </script>
</head>
<body>
  <button onclick="OpenNewWindow()">Click me</button>
    <script>
        function OpenNewWindow() {
            var oPage = document.body;
            var gObjExecuter = document.createElement("DIV");
            gObjExecuter.style.visibility = "hidden";

            gObjExecuter.oncomplete = function () { onComplete(); };

            gObjExecuter.style.behavior = "url(Wizard.htc)";
            oPage.appendChild(gObjExecuter);
        }
    </script>    
</body>
</html>

Wizard.htc

<ATTACH	EVENT="onreadystatechange" HANDLER="DoInit"/>
<PUBLIC:EVENT NAME="oncomplete" Id="oncomplete"/>

<script language="javascript" src="Wizard.js"></script>

Wizard.js

function DoInit() {
    if (readyState == "complete") {
        var prova = $(this).attr("oncomplete");
        alert(typeof prova);
        $(prova)();
    }
}

Thank you Nicolás

Change History (3)

comment:1 Changed 6 years ago by nicolas@…

PS: I'm sorry for code pasted, but it doesn't work on JsFiddle.

comment:2 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed

This isn't a jQuery bug report. Ask for help on StackOverflow or elsewhere.

comment:3 Changed 6 years ago by anonymous

jQuery does not respond in the same manner in two different browser. Are you telling me that is a code problem? You are not reading this bug. If you remove event in htc, jQuery respond in the same manner between IE 10 and IE 11. It is a problem with IE 11 compatibility!

Note: See TracTickets for help on using tickets.