last day (14 days later) » 

3:45 PM
0
A: Cant Access Json Output

Santiago VarelaYour JSON in: Array [ "{"type":"track","artist":"Jax Jones…", "{"type":"track","artist":"MK, Becky…", "{"type":"track","artist":"Wankelmut…" Seems to be malformed. There shouldn't have a quotation mark as "{"type": You must parse your JSON differently. Declare in your console: var data =...

 
I receive data.join is not a function like said above in José Quinto Zamora Answer!:)
 
If you try this in developer tools it works. Could you be kind as to point out the variable name of the data you get back? What argument do you send to JSON.parse(/*Argument??*/)? Whatever your JSON argument is there, then you can apply: responsedata = JSON.parse("[" + argumentName.join(",") + "]");
 
My argument is data. I will post full ajax code above!
 
So data = ["{\"type\":\"track\",\"artist\":\"Jax Jones, Raye\",\"title\":\"You Don't Know Me\",\"album\":\"You Don't Know Me\",\"duration\":214000,\"offset\":0,\"available\":true,\"p‌​opularity\":88}"..‌​..‌​....] ??
 
I updated my Question. If i console.log(data). I receive: ["{\"type\":\"track\",\"artist\":\"Jax Jones, Raye\",\"title\":\"You Don't Know Me\",\"album\":..
I receive: TypeError: data.join is not a function[Learn More] error in console log
 
3:45 PM
With the "var" before "responsedata" as well?
 
Correct :/
 
I updated the answer again there...
Now I'm converting data to an array
Does that work?
 
Will try now! Didnt no it could be so damn difficult!:o
 
Me neither :) haha
 
I now receive: SyntaxError: JSON.parse: unexpected character at line 1 column 3 of the JSON data[Learn More]
 
3:51 PM
Mmm...
show me your JSON.parse line?
Or the whole ajax call, to see how it looks now...?
I think you might be parsing twice?? Using JSON.parse two times?
 
Sure 1 sec!:)
 
Cool
This happens in a console, using pure JS...
 
4:14 PM
Hi there! If you view my answer, i sorted it out:) Thank you very much for the help! Much appreciated!!
 
Sure, no prob!
Sorry I couldn't help further
 

last day (14 days later) »