[jQuery] Re: G is undefined

2009-06-29 Thread expresso
Ok, figured out that data.items is undefined. Not sure why because here's the json my url returns: [{ImageTag:lt;img src=quot;http://www.xxx.com/image/473.jpgquot; alt=quot;quot;gt;},{ImageTag:lt;img src=quot;http:// www.xxx.com/image/4852.jpgquot; alt=quot;quot;gt;}] On Jun 29, 10:33 am,

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
Ok, figured out that data.items is undefined. Not sure why because here's the json my url returns: [{ImageTag:lt;img src=quot;http://www.xxx.com/image/473.jpgquot; alt=quot;quot;gt;},{ImageTag:lt;img src=quot;http:// www.xxx.com/image/4852.jpgquot; alt=quot;quot;gt;}] On Jun 29, 10:33 am,

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
Ok, figured out that data.items is undefined. Not sure why because here's the json my url returns: [{ImageTag:lt;img src=quot;http://www.xxx.com/image/473.jpgquot; alt=quot;quot;gt;},{ImageTag:lt;img src=quot;http:// www.xxx.com/image/4852.jpgquot; alt=quot;quot;gt;}] On Jun 29, 10:33 am,

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
So is this valid JSON that jQuery can parse? or do I need an initial level such as Images: [{Images : [{ImageTag:lt;img src=quot;http://www.xxx.com/image/473.jpg; alt=quot;quot;gt;},{ImageTag:lt;img src=quot;http:// www.xxx.com/image/4852.jpg alt=quot;quot;gt;} ]] On Jun 29, 10:37 am, expresso

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
So is this valid JSON that jQuery can parse? or do I need an initial level such as Images: [{Images : [{ImageTag:lt;img src=quot;http://www.xxx.com/image/473.jpg; alt=quot;quot;gt;},{ImageTag:lt;img src=quot;http:// www.xxx.com/image/4852.jpg alt=quot;quot;gt;} ]] On Jun 29, 10:37 am, expresso

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
So is this valid JSON that jQuery can parse? or do I need an initial level such as Images: [{Images : [{ImageTag:lt;img src=quot;http://www.xxx.com/image/473.jpg; alt=quot;quot;gt;},{ImageTag:lt;img src=quot;http:// www.xxx.com/image/4852.jpg alt=quot;quot;gt;} ]] On Jun 29, 10:37 am, expresso

[jQuery] Re: G is undefined

2009-06-29 Thread MorningZ
Wow, is posting the same thing every 3 mins to bump your topic annoying Anyways, your results wrapped in [ ] signifies an Array, not a JSON object hence .getJSON has no idea what to do with it On Jun 29, 11:53 am, expresso dschin...@gmail.com wrote: So is this valid JSON that

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
yea, refreshing the page posts again, very annoying On Jun 29, 10:58 am, MorningZ morni...@gmail.com wrote: Wow, is posting the same thing every 3 mins to bump your topic annoying Anyways, your results wrapped in [ ] signifies an Array, not a JSON object  hence .getJSON has

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
this is how I'm sending the JSON, so it adds [ ] http://weblogs.asp.net/scottgu/archive/2007/10/01/tip-trick-building-a-tojson-extension-method-using-net-3-5.aspx On Jun 29, 10:58 am, MorningZ morni...@gmail.com wrote: Wow, is posting the same thing every 3 mins to bump your topic annoying

[jQuery] Re: G is undefined

2009-06-29 Thread MorningZ
http://en.wikipedia.org/wiki/JSON will show you what it should look like... notice the outside symbols are { ... }, not [ ] again, you should look at this if you are working with .NET and JSON, it really takes all this guess work from the equation:

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
Thanks I've seen this but would rather stay away from any libraries right now. So basically yea, should be {} I just wonder why the ASP.NET 3.5 JavascriptSerializer class doesn't produce the right output. On Jun 29, 11:03 am, MorningZ morni...@gmail.com wrote:

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
some tells me that my original JSON is totally valid with the [ and ] On Jun 29, 11:03 am, MorningZ morni...@gmail.com wrote: http://en.wikipedia.org/wiki/JSON will show you what it should look like... notice the outside symbols are { ... }, not [ ] again, you should look at this if

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
I even sent a test string without the [ ] and I still get 'undefined' for my alert here: function mycarousel_itemLoadCallback(carousel, state) { // Only load items if they don't already exist if (carousel.has(carousel.first, carousel.last)) { return; }

[jQuery] Re: G is undefined

2009-06-29 Thread Michael Geary
That's right, your JSON is perfectly valid. You can test it at: www.jsonlint.org Here's the formatted output from that site, with the image tags elided for clarity, and comments added showing how you'd access each part of it directly in JavaScript: // Data [ // Data[0]

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
Mike thanks a lot. That is so weird. I got some ideas from http://docs.jquery.com/GetJSON and as you can see from the example it's using data.items. it's working now. I just wonder why the jQuery example is using data.items On Jun 29, 12:19 pm, Michael Geary m...@mg.to wrote: That's right,

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
I understand. Thanks for the explanation. On Jun 29, 12:19 pm, Michael Geary m...@mg.to wrote: That's right, your JSON is perfectly valid. You can test it at: www.jsonlint.org Here's the formatted output from that site, with the image tags elided for clarity, and comments added showing

[jQuery] Re: G is undefined

2009-06-29 Thread Michael Geary
In addition to www.jsonlint.org, since you're developing on Windows, head over here right now and get the Fiddler debugging proxy server: http://www.fiddler2.com/ Then, go to the Extensions page: http://www.fiddler2.com/Fiddler2/extensions.asp At the very least get the JSON Viewer (at the

[jQuery] Re: G is undefined

2009-06-29 Thread Karl Swedberg
The jQuery example is using data.items because the JSON object it is retrieving is different from yours. Its JSON object is coming from the flickr API. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jun 29, 2009, at 1:25 PM, expresso wrote: Mike

[jQuery] Re: G is undefined

2009-06-29 Thread Michael Geary
The jQuery example uses data.items because the JSON data it fetches is an object with an items property. Load the sample URL in your browser and look at the data: http://api.flickr.com/services/feeds/photos_public.gne?tags=cattagmode=any format=json

[jQuery] Re: G is undefined

2009-06-29 Thread expresso
Thanks all. On Jun 29, 1:12 pm, Michael Geary m...@mg.to wrote: The jQuery example uses data.items because the JSON data it fetches is an object with an items property. Load the sample URL in your browser and look at the data: