Can you use YAML instead of JSON?

Can you use YAML instead of JSON?

harmenzonharmenzon Posts: 17Questions: 7Answers: 0

Hello. I hope this question has not been asked before. I would like to use YAML as my Ajax data source (objects) instead of JSON. I can get it working with JSON. But when I use YAML I get the following error: "Invalid JSON Response".
Any help is much appreciated.

Answers

  • allanallan Posts: 63,839Questions: 1Answers: 10,518 Site admin

    DataTables accepts JSON since it is native to Javascript and requires no translation. To use another data format such as YAML or XML you would need to translate that data into something Javascript understands (i.e. basically convert it to JSON).

    I'm sure there are various libraries around that will do that. The ajax.dataSrc option is where you can transform the data returned from the server.

    Allan

This discussion has been closed.