error in crome :
Uncaught SyntaxError: Invalid or unexpected token
output showing crome :
<a onclick="DeleteOrdersDtl('FH001" ');="">Delete</a>
error in firefox :
Uncaught SyntaxError: '' string literal contains an unescaped line break
output showing firefox:
<a onclick="DeleteOrdersDtl('FH001" ');="">Delete</a>
any one can help me
What I have tried:
i have try
<pre>
function getorderdtl(PlanNo) {
$.ajax({
url: "/Home/GetOrdersDtl?PlanNo=" + PlanNo,
type: "GET",
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (result) {
var html = '';
$.each(result, function (key, item) {
html += '<tr>';
html += '<td>' + item.VsNo + '</td>';
html += '<td>' + item.Weight + '</td>';
html += '<td>' + item.Quality + '</td>';
html += '<td>' + item.GSM + '</td>';
html += '<td>' + item.Width + '</td>';
html += '<td>' + item.Length + '</td>';
html += "<td><a onclick='return getbyID(" + item.TxnNo + ")'>Edit</a> | <a onclick=DeleteOrdersDtl('"+ item.TxnNo +"');>Delete</a></td>";
html += '</tr>';
});
$('.tbody').html(html);
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
}
but it not woorking for me
i also try another one
function getorderdtl(PlanNo) {
$('#orderdtl').DataTable({
destroy: true,
"ajax": {
"url": '/Home/GetOrdersDtl?PlanNo=' + PlanNo,
"type": 'POST',
"datatype": 'json'
},
"columns": [
{ "data": "VsNo", "name": "VsNo", "autoWidth": true },
{ "data": "Weight", "name": "Weight", "autoWidth": true },
{ "data": "Quality", "name": " Quality ", "autoWidth": true },
{ "data": "GSM", "title": "GSM", "name": "GSM", "autoWidth": true },
{ "data": "Width", "title": "Width", "name": "Width", "autoWidth": true },
{ "data": "Length", "name": "Length", "autoWidth": true },
{
"render": function (data, type, full) {
return "<a class='btn-danger' onclick=DeleteOrdersDtl('" + full.TxnNo + "')>"></a> | <a style='font-size:12; color:white; background-color:green; padding:4px;border-radius:4px;margin-left:2px' class='btn-primary' onclick=EditOrderDtl('" + full.TxnNo + "')>^__i class="fa fa-edit"></a>";
}
}
]
});
}
other way i tried
return '<a class="btn-danger" onclick=DeleteOrdersDtl("'+ full.TxnNo +'")></a>';
return '<a class="btn-danger" onclick=DeleteOrdersDtl('+ full.TxnNo +')></a>';
but its not working for me