What happens if you put the whole $.ajax statement in a try/catch
statement? Does it catch?

On Oct 1, 7:24 am, mike <randall...@gmail.com> wrote:
> Right!  I'm having the same problem--neither the error nor the
> complete are being called.  The request just fails, probably because
> the responseText is not JSON.
>
> I've had no luck searching around for answers to this either.  Guess
> we'll have to wait until the jQuery JSONP plugin is more mature.
> ( ._.)
>
> Mike
>
> On Sep 28, 9:13 pm, Alex <bretwal...@gmail.com> wrote:
>
> > I'm making a call to a Twitter JSON feed, and when I pass an incorrect
> > username, jQuery's ajax complete method never gets called.
>
> > An example of a JSON response that causes complete not to be called
> > (nor error, nor success) 
> > is:http://twitter.com/users/show.json?screen_name=bhdjbhubeuhfbfbjfbjf
>
> > Here's my code:
>
> > $.ajax({
> >         type: "GET",
> >         url: "http://twitter.com/users/show.json";,
> >         cache: false,
> >         data: "screen_name=" + $('#account-id').val().replace(/^\s*|\s*$/
> > g,''),
> >         dataType: "jsonp",
> >         async: true,
> >         success: function(j){
> >                 alert('success');
> >         },
> >         error: function(xhr, ajaxOptions, thrownError) {
> >                 alert(xhr + ' ' + ajaxOptions + ' ' + thrownError);
> >         },
> >         complete: function() {
> >                 alert('finished');
> >         }
>
> > });
>
> > Any ideas on why the complete method isn't getting called?
>
> > Shouldn't this always get called?
>
> > Thanks!
>
>

Reply via email to