首页 > 解决方案 > 带有 apache cordova 的 Visual Studio 2017 应用程序在使用 Debug-Windowsx64-Local Machine 的 AJAX Post 上获得 NetworkError 但适用于 Android 和 IOS

问题描述

我在使用 Apache Cordova Proyect 时遇到了这个问题……调试与 Android Emulator 和 IOS 完美配合……但是在 Windows 中,我在函数中遇到 NetworkError(结果)……这是我的代码:

function Vendedores() {
    $.ajax({
        type: "POST",
        url: 'http://' + document.getElementById("servidor").value + '/Proformas.aspx/CargaVendedores',
        data: '{pnumero:"0"}',
        contentType: "application/json; charset=utf-8",
        datatype: "json",
        crossDomain: true,
        async: false,
        success: function (resulta) {
            $.each(resulta, function (i, field) {
                //some stuff....
            });
        },
        error: function (resulta) {
            alert("no se pudo cargar los vendedores, revisar  conectividad con el servidor");
        },
    });
}

标签: visual-studio-2017apache-cordovajquery-mobile-ajax

解决方案


推荐阅读