data-url attribut only with .json files?
See original GitHub issueHey all, i dont know if its supported or whatever i do wrong but i cant get work the data-url attribut of the table with a http api json call.
when i open my api
as example:
www.xyz.aaa/api/test
i get a blank page with data in json format.
if i add this url as data-url the table tell me “No matching records found”
if i copy all content from the http request and save it to a new file called test.json and put this file on my webserver and i call it in the data-url attribut to www.xyz.aaa/api/test.json it work!
i not changed anything on the json format i got! just saved this as a file. on the web request (the page where i copied the json string) its its typ: application/json
so my question: can i get it to work without saving this to a file every time i call it? it should work “on the fly” with the url call or iam completly wrong?
i have to use these attributes:…(here complete table):
`
# | Title | Body |
---|
my json output is like this: OUTPUT: {“test”:[{“userid”:“1”,“id”:“1”,“title”:“test”,“body”:“test”}]}
i dont know what i should add here for files to resolve this… if you need any let me know.
Thank You all!
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (4 by maintainers)
Top GitHub Comments
use responseHandler
add attribute data-response-handler=“responseHandler”
in js:
function responseHandler(res){ return res.test }
For all who has the same problem, this will remove completly the query parameters.
HTML Attribute:
data-query-params=“queryParams”
JS:
function queryParams() { return { };
@wenzhixin Can you close this? Thank you!