On May 23, 2006, at 7:41 AM, [EMAIL PROTECTED] wrote:

>
> You're right, of course I should have supplied a runnable example.
> Here goes, it's not beautiful, but it illustrates my problem:
--
>               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);
>
>               }
---
> 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); }

Your problem is that you're calling objectToString on the  
XMLHttpRequestObject. You can't do that. The XMLHttpRequest object  
has enumerable properties that you don't have permission to access  
from the browser (which is why it says permission denied). You'll  
have to write a version of objectToString that does a try{}catch{} in  
the loop so that it skips properties that you do not have access to  
view.

-bob


--~--~---------~--~----~------------~-------~--~----~
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