Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
And what is entry?
$.each(data, function(entryIndex, entry){
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
mark reyes wrote:1. Why is it that I get undefined value when I replace this code with this
The this keyword refers to the current object as I checked with the firebug console.
2. Libraries such as GSON/JSON Lib return a stringify representation of my java objects and does not really return a javascript construct? It is upto you to use the eval() function to convert this to a javascript construct. Is my understanding correct?
3. In the jquery api, I notice the [] (square bracket), does it signifies that this returns an array.
You're getting a string? Not a JavaScript construct? If that's the case, then of course you can't reference into it until its been converted to a construct.
If jQuery is not doing it for you, chances are that the JSON coming back from the response is malformed.
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Note The extra parentheses are used make eval unconditionally treat the source input like an expression. This is especially important for objects. If you try to call eval with a string containing JSON text that defines an object, such as the string "{}" (meaning an empty object), then it simply returns undefined as the parsed result. The parentheses force the JavaScript parser to see the top-level curly braces as the literal notation for an Object instance rather than, say, curly braces defining a statement block. Incidentally, the same problem does not occur if the top-level item is an array, as in eval("[1,2,3]"). For sake of uniformity, however, JSON text should always be surrounded with parentheses prior to calling eval so that there is no ambiguity about how to interpret the source.
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
The JSON that is being returned defines rows as a string. It will not evaluate to a structure. You need to fix the JSON, not hack the page
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
Space pants. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|