locked
Access denied when call XMLHttpRequest.open() in the iframe

    Question

  • I try to use XMLHttpRequest to POST some data.

    If I put this function in default page (ex. program.js in default.html), it works correctly.

     

    But when I add an iframe into default.html by

    <iframe id="uploadIframe" src="ms-wwa-web:///upload.html"></iframe>
    

    and put XMLHttpRequest into upload.html .

    In this situation, when call XMLHttpRequest.open(), it will show

    "JavaScript runtime error: Access is denied."

     

    In another way,

    WinJS.xhr({ type: "POST", url: url, data: formData }).then(function (response) {}, function (err) {});
    

    have the same result in err

    "{"message":"Access is denied.\r\n","description":"Access is denied.\r\n","number":-2147024891}"
    


    Is this the limitation?

    Is there any solution or workaround?

     

    Thanks!

    Thursday, December 01, 2011 9:54 AM

Answers

All replies