You're right, of course I should have supplied a runnable example.
Here goes, it's not beautiful, but it illustrates my problem:

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

<head>
    <meta content="text/html; charset=iso-8859-1"
http-equiv="content-type">

        <title>test</title>
        <script src="../static/javascript/lib/MochiKit.js"
type="text/javascript"></script>

        <script type="text/javascript">

                function test()  {

                        var one = postJSONDoc('test.json', {});
                        var two = postJSONDoc('test2.json', {});

                        var list = new DeferredList([one, two], false, false, 
true);
                        list.addCallback(function (resultList) {

                                if ( ! resultList[0][0] || ! resultList[1][0])  
{

                                log("failed!", objectToString(resultList[0][1]),
objectToString(resultList[1][1]));
                                }

                                else  {
                                        gotOne(resultList[0][1]);
                                        gotTwo(resultList[1][1]);
                                }

                        });


                        function gotOne(result)  {
                                alert("One: got result " + 
objectToString(result) );
                        }

                        function gotTwo(result)  {
                                alert("Two: got result " + 
objectToString(result) );
                        }


                }

                function objectToString(object)  {

                        var s = "";

                        for (var index in object)  {
                                s = s + index + " = " + object[index] + "\n";
                        }

                        return s;
                }


                function postJSONDoc(url, postVars) {

                        var req = getXMLHttpRequest();
                        req.open("POST", url, true);
                        req.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
                        var data = queryString(postVars);
                        var d = sendXMLHttpRequest(req, data);


                        // check if a special reply from server
                        /*var serverMsgCallback = function(result)  {
                                alert(objectToString(result));
                                return maybeDeferred(result);
                        }

                        d.addCallback(serverMsgCallback);*/
                        return d.addCallback(evalJSONRequest);

                }

        </script>

</head>

<body onload="test()">
</body>

</html>


It works, that is, gotOne() and gotTwo() get the contents of files
test.json and test2.json as JSON objects.

However, if I uncomment these lines

                        /*var serverMsgCallback = function(result)  {
                                alert(objectToString(result));
                                return maybeDeferred(result);
                        }

                        d.addCallback(serverMsgCallback);*/

I get the same error as before.


test.json:
{"name": "MochiKit", "version": "0.5"}

test2.json:
{"name": "MochiKit2", "version": "2"}

The error I get two instances of:
message = Permission denied to get property XMLHttpRequest.channel
name = MochiKit.Async.GenericError
fileName = MochiKit.js
lineNumber = 849
stack = Error()@:0 ()@MochiKit.js:849 @MochiKit.js:876
repr = function () { if (this.message && this.message != this.name) {
return this.name + "(" + m.repr(this.message) + ")"; } else { return
this.name + "()"; } } toString = function () { return
this[_30].apply(this, arguments); }


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to