avatar image
Former Member

Getting maximum call stack size exceeded error on using ajax post

Getting maximum call stack size error on calling ajax post on login. Cant figure out exactly what is causing this issue. I cant seem to find any recursive function.

 Here is my xmlview file
    <mvc:View
    controllerName="abc.controller.LoginController"
    xmlns:mvc="sap.ui.core.mvc"
    xmlns:u="sap.ui.unified"
    xmlns:c="sap.ui.core"
    xmlns:m="sap.m"
    xmlns:l="sap.ui.layout"
    xmlns:tnt="sap.tnt">
    <m:Page
    id="loginPage"
    showHeader="false"
    enableScrolling="false"
    class="sapUiContentPadding">
    <m:Panel width="30%">
    <l:Grid>
    <l:content>
    <l:VerticalLayout>
    <m:Label text="User Name" design="Bold"/>
    <m:Input id="username"/>
    </l:VerticalLayout>
    <l:VerticalLayout>
    <m:Label text="Password" design="Bold"/>
    <m:Input id="password" type="Password" />
    </l:VerticalLayout>
    <l:VerticalLayout>
    <m:Button id="loginBtn" text="Login" press="toTablePage" />
    </l:VerticalLayout>
    </l:content>
    </l:Grid>
    </m:Panel>
            </m:Page>
    </mvc:View>

My login controller js file is

    sap.ui.define([
    "sap/ui/core/mvc/Controller",
    "sap/ui/model/json/JSONModel",
    "sap/m/MessageToast"
    ], function(Controller, JSONModel, MessageToast) {
    "use strict";
    return Controller.extend("abc.controller.LoginController", {
            onInit: function(){
            },
            toTablePage: function(){

    var userName = this.byId("username");
    var password = this.byId("password");

    if(userName.getValue()!== "" && password.getValue()!== ""){

    var aData = jQuery.ajax({
    type: "POST",
    contentType: "application/json",
    url: "http://localhost:3000/api/logins",
    dataType: "json",
    data: jQuery.param({ email: userName, password : password}) ,
    success: function (data, textStatus, jqXHR) {
    alert(textStatus);
    }
    });
    }
    else
    MessageToast.show("the username or password is wrong");
            }
    });
    });
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 04, 2017 at 02:01 PM

    show error screenshot

    Add comment
    10|10000 characters needed characters exceeded

Skip to Content