On Apr 17, 10:55 am, mkmanning <michaell...@gmail.com> wrote:
> >- the dataType is "JSON", not "json".
> >(I pointed this out earlier in this thread)
>
> I noticed what sneaks did, I also noticed you had pointed it out,
> which is why my comment was in direct reply to sneaks post about the
> 'object side' and removing the quotes (check the quoted text in my
> post to see that it was for that post specifically) and was predicated
> on the assumption that he'd read and applied your suggestion. It was
> simply an FYI for him that that terminology ('object side') didn't
> make sense, and that the now-resolved object works perfectly fine with
> quotes on the name portion of the name-value pairs.
>
> I understand how jQuery handles the response, that's why I further
> indicated using the correct type in my follow up; I also understand
> that you can't eval an object. Neither of those have anything to do
> with my direct comment to sneaks.
>
Actually, eval takes any value for its argument. If that value is not
a string, it is returned.
For example:-
var x = {};
alert(x === eval(x));
elerts true.
> >OK. I think this clarifies that |json| is not an object, but a
>
> string.
>
> No, it clarifies that an ajax responseText formatted as JSON is a
> string, but that was never in question, as I've indicated above. As
> far as we're clarifying however: JSON isn't a string, it's text. The
> responseText from an ajax call is a string, and it may be in JSON
> format or it may not. If you want to quibble about whether the
> resolved object should then be called JSON that's fine, but also
> totally beside the point.
>
It *is* a string, not "formatted as". Figuring out value of that
variable was important in debugging that.
sneaks had expected that the variable json was an object (in code and
in explanation). He had used "JSON" for the dataType. Using "json"
instead would result in the jQuery method returning an object (it is
just called "an object," not a "json" object).
Garrett
[snipped previous post]