Problem with accessing in DOM with jQuery
Posted
by Tristan
on Stack Overflow
See other posts from Stack Overflow
or by Tristan
Published on 2010-04-18T23:59:30Z
Indexed on
2010/04/19
0:13 UTC
Read the original article
Hit count: 213
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
ordata.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 whattextStatus
orXMLHttpRequest
are here too and why ?!
Thank you.
© Stack Overflow or respective owner