Google Groups Home
Help | Sign in
Message from discussion $getJSON problem...demo works, but not my code?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Danny  
View profile
 More options Mar 13, 8:54 am
From: Danny <d.wac...@prodigy.net>
Date: Thu, 13 Mar 2008 05:54:43 -0700 (PDT)
Local: Thurs, Mar 13 2008 8:54 am
Subject: Re: $getJSON problem...demo works, but not my code?
Try going to the commadelimited.com URL directly in your browser. It
looks like it's not returning the correct JSONP format.
Flickr returns (with callback=foo in the URL):
foo( {...json...} )
and commadelimited returns:
[ {...json...} ]

So it looks like the problem is on the server side.

Remember, jQuery uses JSONP by creating a <script> element and using
the URL as the src attribute, so the returned text is executed as
javascript.
foo( {...json...} );
calls the function foo with the relevant data so you can use it.
[ {...json...} ];
creates an array with the data but promptly throws it away.

Danny

On Mar 13, 6:51 am, Andy Matthews <andyandja...@gmail.com> wrote:

> For the above code sample, it correctly throws an alert, then outputs
> images of cats into the specified container.

> For my code it does nothing. No errors, but also no alert. It's almost
> like it's not returning anything to the page, but in Firebug I see
> that the call is being made. In fact, here's the URL that Firebug
> shows is going out:

> http://www.commadelimited.com/uploads/bullhorn/bullhorn.cfc?method=re...

> On Mar 13, 6:35 am, MorningZ <morni...@gmail.com> wrote:

> > When you say "get an error", what's the error?

> > Do you use Firebug (http://www.getfirebug.com) at all to help? it's
> > great to help diagnose script/AJAX problems


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google