tengo esta funcion en jsfiddle
https://jsfiddle.net/609erfx4/
y anotaré el código, no puedo ver el código en alerta, hay algo mal en él
var str = '[{ "data": "ID", "title": "Bill ID", "autoWidth": true }, { "data": "BillRef", "title":"Bill Ref", "autoWidth": true }, { "data": "BillDate", "title": "Bill Date", "autoWidth": true }, { "data": "BillAmount", "title": "Bill Amount", "autoWidth": true }, { "data": "BillPaid", "title": "Bill Paid", "autoWidth": true }, { "data": "BillBalance", "title": "Bill Balance", "autoWidth": true, "orderable":false }, { "data": "PaymentDate", "title": "Payment Date", "autoWidth": true, "orderable":false }, { "data": "Contact", "title": "Contact", "autoWidth": true, "orderable":false }]'; function f() { alert(str); }