question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

data-url attribut only with .json files?

See original GitHub issue

Hey 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:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
panxq5commented, Aug 9, 2016

use responseHandler

add attribute data-response-handler=“responseHandler”

in js: function responseHandler(res){ return res.test }

0reactions
PeterPlanloscommented, Aug 17, 2016

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Store JSON object in data attribute in HTML jQuery
The nice thing is that the string in the data- attribute is automatically converted to a JavaScript object. I don't see any drawback...
Read more >
Web Basics - Accessing JSON data from URL - YouTube
This video shows how to access JSON data from a URL using JS and the JQuery resource.
Read more >
JavaScript read JSON from URL - ZetCode
Reading JSON from URL in JavaScript tutorial shows how to read data in JSON format from the provided URL.
Read more >
How to read a JSON file from a URL in JavaScript - Educative.io
I will test one such algorithm on JSON data. In JavaScript, there are several methods to read JSON data through a URL such...
Read more >
Working with JSON - Learn web development | MDN
JSON exists as a string — useful when you want to transmit data across a network. It needs to be converted to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found