locked
Unhandled exception at line 3, column 1 in script block 0x800a1391 - JavaScript runtime error: 'BLR' is undefined RRS feed

  • Question

  • User1979860870 posted

    Hi

     I am getting above error on below line

    {
                    "data": "Id", "render": function (data) {
                        return "<a class='btn btn-primary btn-sm' id='btnEdit' data-id='Id'><i class='fa fa-pencil'></i> Edit</a> <a class='btn btn-danger btn-sm' style='margin-left:5px' onclick=ConfirmDelete(" + data + ")><i class='fa fa-trash'></i> Delete</a>";
                    },
                    "orderable": false,
                },
    
    ******************
    var ConfirmDelete = function (Id) {
    
        $("#hiddenId").val(Id);
        $("#DeleteModal").modal('show');
        alert($("#hiddenId").val);
    }

    Thanks

    Monday, May 31, 2021 4:25 PM

All replies

  • User-939850651 posted

    Hi jagjit saini,

     I am getting above error on below line

    Mentioned in the error message given: 'BLR' is undefined.

    What is ‘BLR’? Custom function? Or something else? I did not find relevant information in the code you provided.

    Did you try to put the javascript code after the body? I think this might be useful to you.

    If possible, could you provide more deatils so that we can better help you find a solution to the problem?

    Best regards,

    Xudong Peng

    Tuesday, June 1, 2021 5:47 AM
  • User-474980206 posted

    The variable data is probably not a number, so you need to put quotes around its value in the script generation. Also the onclick value needs quotes.

    onclick=‘ConfirmDelete(\”" + data + "\”)’><
    Tuesday, June 1, 2021 2:31 PM