Monaca Onsen UI Discord Chat Github Repo

Ajax api Call



  • Hello Guys,
    I am new in this Onsen ui.
    I want to know how to call ajax in onsen ui same as the below code, same is working fine in html but no in Onsen.
    Please tell me how to call.

    var person = {}
    person[“ContactNo”] = “9428299999”;
    person[“Pwd”] = “123”;
    alert(JSON.stringify(person));
    $.ajax({
    url: “http://voting.somee.com/api/AjaxAPI/LoginAuth”,
    type: ‘post’,
    dataType: ‘json’,
    //contentType: ‘application/json’,
    data: person,
    success: function (data) {
    var myJSON = JSON.stringify(data);
    alert(myJSON);
    },
    error: function (response) {
    alert(response.responseText);
    }

                });