1
Vote

the array NotSupportExcetpion.

description

A Page:


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>

    <script type="text/javascript">
        function fun1() {
            var c = [];
            
            this.frames[0].PostObj(c);
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <input type="button" onclick="fun1()" value="fun1" />
        </div>
        <iframe src="http://localhost:9715/Default.aspx"></iframe>
    </form>
</body>
</html>
B Page:
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>

    <script type="text/javascript">
        
        function PostObj(item) {
            var c = item.constructor;
            alert(c);
            alert(c == Array);
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    i'm B page
    </div>
    </form>
</body>
</html>
ok... the code is description the array send to iframe page, array is not array.

so . on core.js, line 245, toJSON method.
            else if (c == Array) {
        for(i=0; i<o.length; i++) {
            v.push(AjaxPro.toJSON(o[i]));
        }
        return "[" + v.join(",") + "]";
    } 
i change :

add. AjaxPro.isArray
isArray: function (arg) {
    if (!Array.isArray) {
        return Object.prototype.toString.call(arg) === '[object Array]';
    } else {
        return Array.isArray(arg);
    }
},
and change: 245 line:
            else if (AjaxPro.isArray(o)) {
        for(i=0; i<o.length; i++) {
            v.push(AjaxPro.toJSON(o[i]));
        }
        return "[" + v.join(",") + "]";
    } 
Ok...this bug . fixed...

patch 16274...

comments