Skip to content Skip to sidebar Skip to footer

Webview Windows Store App C# Ajax Not Working

Does Ajax not work in a XAML WebView? Whenever I make an Ajax call it always runs the error callback. Just for your reference here is the test.js code: $(function () { $.ajax({

Solution 1:

your ajax call should be

      $.ajax({
            type: "GET",
            url: "fake_domain_here/api/v1/api_call",
            data: "{}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (data) {
               alert(data.d);
            },
            error: function () { alert(arguments[2]); }
        });

Solution 2:

Turns out that in the ajax I had datatype and not dataType. The difference made it worked. That is strange that Android and iOS doesn't care if it is datatype or dataType. But now it works!

Thanks.

Post a Comment for "Webview Windows Store App C# Ajax Not Working"