Problem with acceding in DOM with jQuery
- by Tristan
Hello,
I changed the tree of my JSON-P output, and i cannot access to my object DOM anymore :
Here's my output :
jsonp1271634374310(
{"Inter-Medias":
{"name":"Inter-Medias","idGSP":"14","average":"80","services":"8.86"}
});
And here's my jQuery script :
success: function(data, textStatus, XMLHttpRequest){
widget = data.name;
widget += data.average ;
....
I know one level is missing, but if I try to do : data.Inter-Medias.name or data.name.name
it's still not working.
Any idea please ?
I will have case where i'll have multiple Ojbect, so i want to display all of them, how to do that ?
for (i=0;i < data.length;i++)
Does it look right ?
Bonus question : i understand function(data, textStatus, XMLHttpRequest) that in case of success this function is triggered, the data is what the script recieved from his request, but i have no idea what textStatus or XMLHttpRequest are here too and why ?!
Thank you.