find and solve || findandsolve.com
Please wait.....

Uncaught RangeError: Maximum call Stack Size Exceeded at RegExp.test (<anonymous>)

Uncaught RangeError: Maximum call Stack Size Exceeded at RegExp.test (<anonymous>)

I have create javascript function in ASP.NET MVC.

var accountSearch = function (val, fromDate, endDate, searchHtmlInnerId, actionName, controllerName) {
    $('#requst-loder').show();
    $.ajax({
        url: "/" + controllerName + "/" + actionName,
        type: 'GET',
        data:
        {
            fromDate: fromDate,
            toDate: toDate,
            val: val,
        },
        success: function (result) {
            $(searchHtmlInnerId).empty();
            $(searchHtmlInnerId).html(result);
            $('#requst-loder').hide();
        },
        error: function () {
            $('#requst-loder').hide();
        }
    });
};

When i have call the function from by Razor page as given below

            <button class="btn btn-primary" 
                style="margin-top: 22px;"
                onclick="accountSearch($('#val').val(),$('#fromDate').val(),$('#toDate').val(),'#report_div','_MyActionName','MyControllerName')">
                 <i class="fa fa-search"></i>
                  Search
            </button>


When I have click this button error has been occured as given below

Uncaught RangeError: Maximum call stack size exceeded

    at RegExp.test (<anonymous>)

    at Object.<anonymous> (jquery-2.1.4.min.js:4)

    at Function.each (jquery-2.1.4.min.js:2)

    at Ab (jquery-2.1.4.min.js:4)

    at Ab (jquery-2.1.4.min.js:4)

    at Ab (jquery-2.1.4.min.js:4)

    at Object.<anonymous> (jquery-2.1.4.min.js:4)

    at Function.each (jquery-2.1.4.min.js:2)

    at Ab (jquery-2.1.4.min.js:4)

    at Ab (jquery-2.1.4.min.js:4)

browserLink:37 XHR finished loading: GET "http://localhost:1840/8cd907ce510f4e3da26a9c13af87268a/browserLinkSignalR/ping?requestUrl=http%3A%2F%2Flocalhost%3A8166%2FAccountReport%2FLedger&browserName=Chrome&userAgent=Mozilla%2F5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit%2F537.36+(KHTML%2C+like+Gecko)+Chrome%2F88.0.4324.190+Safari%2F537.36&_=1614658861101"


Answers


Option 1.

In  your code "toDate" is not defined.So this  types of error has been occured.Please check your code .


Option 2.

Mine was more of a mistake, what happened was loop click(i guess) basically by clicking on the login the parent was also clicked which ended up causing Maximum call stack size exceeded.

$('#YourButtonId').click(function(){
   $('.request').click();
});

<buttonid="YourButtonId">
  <a href="#" class="request">request text</a>
</button>

Option 3.

 $(document).on('click','p.class_or_id',function(e){
   e.preventDefault();
      // your full code here
   });

Mahira  khanna

Mahira khanna

I have the skills you need for you company blog, website, or other content materials

Comments



Report Response