Uncaught TypeError: undefined Error RRS feed

  • Question

  • User-1355965324 posted

    When I call the javascript function from the   anchor tag  the following error  is coming 'VM12 jquery.dataTables.min.js:62 Uncaught TypeError: Cannot read property 'style' of undefined' Here is my code,  When Please can you help me ?

    <a class="btn btn-primary form-control" onclick="CallLogCreate()" data-ajax="true" data-ajax-mode="replace" data-ajax-update="#content" data-toggle="tooltip" title="New Record"><span class="control-label-left padding-left-ten">Add New   Record</span></a>
     function CallLogCreate() {
                var depot = $('#dropdownDepot').val();
                var departmentNo = $('#dropdownDepartment').val();
                var employeeid = $('#dropdownEmployee').val();
                var href = "/Home/UpdateClockEntry?depotno=" + depot + "&departmentId=" + departmentNo + "&employeeid=" + employeeid;
                $("#lnkFilter").attr('href', href);
     public IActionResult UpdateClockEntry(int depotno, int departentid,int employeeid)
           return view()

    Thursday, March 5, 2020 7:02 AM

All replies

  • User-719153870 posted

    Hi polachan,


    VM12 jquery.dataTables.min.js:62 Uncaught TypeError: Cannot read property 'style' of undefined'

    This error means that you are trying to get the style attribute of an undefined element.

    Are you sure that you provided the right code? since there's no jquery datatable related code and literally no "style" in your provided code.

    Anyway, the reason for this issue is most likely no value assigned to the corresponding object.

    For example, in the js code you have: XXX.style but the XXX never be assigned a specific value or element.

    Please check jquery.dataTables.min.js:62 and you might find  the true reason.

    Best Regard,

    Yang Shen

    Thursday, March 5, 2020 7:53 AM