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,
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,
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,
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
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
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
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
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
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
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:
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:
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
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;
}
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]
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,
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
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
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
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
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:
20 matches
Mail list logo