Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
sboesch5465yJSON is JavaScript??? Not sure what could go wrong there? Rather, the JSON file has errors.
-
@sboesch
Two different files: one a JS, another a JSON. Importing the data using JS from the JSON has been most frustrating -
@volttide
That's what I've been trying. Can I just say `JSON.parse("/path/to/file")`? Cause I've been trying `prev_arg = $.getJSON("/path/to/file"); JSON.parse(prev_arg)`
The code may help explain a bit more https://github.com/RiderExMachina/... -
sboesch5465yYou need to wait for the Ajax request to complete. $.getJSON( "ajax/test.json", function( data ) {console.log(data);});
-
@RiderExMachina The data gets processed INSIDE the callback function, nothing more than that. Maybe return it there or set a global variable at the callback function?
-
-
@RiderExMachina Also, if you're already getting it as a json object, you don't have to parse it by further.
-
@linuxxx @volttide @sboech
It works now. Thanks for clearing all of that up. You can test out the beta copy here: https://riderexmachina.github.io/be... -
I truly thought this was going to be a troll post. Don't judge a book by its cover, kids.
-
@soggybutter
What is it they say about how to get the correct information on the internet? Just say incorrect things until someone corrects you? Or something like that at least.
But honestly, I was just missing one snippet of information that had been causing me pain all day. And it got resolved within 30 minutes after posting here. -
@RiderExMachina
Fair enough! And after reading into the thread it makes much more sense. There was just something beautifully ironic about JavaScript having trouble parsing its own object notation.
Man, fuck JavaScript. It's been basically impossible getting this JSON file to get parsed ðŸ˜
rant
webdev
javascript
json