Javascript and DataTables

44 views
Skip to first unread message

Sebastian M Cheung

unread,
Jul 9, 2015, 4:00:59 PM7/9/15
to nod...@googlegroups.com

Following instructions how to use dataTables


Following this example but where should I place my source data objects_root_array.txt in project directory? 

[
  {
    "name""Tiger Nixon",
    "position""System Architect",
    "salary""$320,800",
    "start_date""2011/04/25",
    "office""Edinburgh",
    "extn""5421"
  },
  {
    "name""Garrett Winters",
    "position""Accountant",
    "salary""$170,750",
    "start_date""2011/07/25",
    "office""Tokyo",
    "extn""8422"
  },...
]
I am using Flask, and I have placed in 

1. same location as my loadjson.js
2. top of project root directory data/objects_root_array.txt







loadjson.js

$(document).ready(function() {
    $('#example').dataTable( {
        "ajax": {
            "url""data/objects_root_array.txt",
            "dataSrc"""
        },
        "columns": [
            "data""name" },
            "data""position" },
            "data""office" },
            "data""extn" },
            "data""start_date" },
            "data""salary" }
        ]
    } );
} );
But it is always file cannot be found with a 404 status?

Paul Spaulding

unread,
Jul 10, 2015, 11:21:36 AM7/10/15
to nod...@googlegroups.com
What does this have to do with node?


On Thursday, July 9, 2015 at 4:00:59 PM UTC-4, Sebastian M Cheung wrote:

Following instructions how to use dataTables


Following this example but where should I place my source data objects_root_array.txt in project directory? 

[
  {
    "name""Tiger Nixon",
    "position""System Architect",
    "salary""$320,800",
    "start_date""2011/04/25",
    "office""Edinburgh",
    "extn""5421"
  },
  {
    "name"
...
Reply all
Reply to author
Forward
0 new messages