Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research XHR/ajax local calls #7

Open
RedWolves opened this issue Jan 28, 2013 · 1 comment
Open

Research XHR/ajax local calls #7

RedWolves opened this issue Jan 28, 2013 · 1 comment
Assignees
Labels

Comments

@RedWolves
Copy link
Contributor

From: http://stackoverflow.com/questions/14266827/how-to-convert-jquery-ajax-call-to-winjs-xhr-or-win8-equivalent/

Seems win8 is blocking local calls with jQuery ajax.

Research this and see if there is a problem we need to look into.

@jonathansampson
Copy link
Contributor

After some testing I've concluded that the statement made in the referenced question ("windows 8 will not allow local ajax calls") is false. The following worked as expected in a sample application running jQuery 2.0pre.

$.ajax({
    url: "page.html",
    success: function (data) {
        $(data).appendTo("body");
    }
});

I can, however, cause this to raise the error the individual was seeing - "Access Denied", but setting the request type to "POST" rather than "GET" (default). I will research this a bit more later to see what, specifically, is the reason for getting this message when attempting an asynchronous POST.

It's worth noting that you get the same message when you attempt a POST with WinJS.xhr as well:

// The following results in 0x80070005 - JavaScript runtime error: Access is denied.
WinJS.xhr({
    url: "page.html",
    type: "POST"
});

You can, however, post to a remote endpoint:

$.ajax({
    url: "http://github.com",
    type: "POST",
    success: function (data) {
        $("body").text(data);
    }
});

@ghost ghost assigned jonathansampson Feb 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants