add code
                        error: function(e,e2,e3){alert(e2);},
before success (in fact you can add anywhere in the ajax object).
i think you will got a alert "error".
if so. that's mean your return is not a well format json.


On Nov 19, 5:37 am, Juriy <juriy.b...@gmail.com> wrote:
> Hi,
>
> I'm trying to use $.ajax function to poll my server for updates.
> Here's the brief code that I use:
>
> $.ajax({
>         url: "endpoint",
>         type: "POST",
>         data: {action : "poll"},
>         dataType: "json",
>         cache: false,
>         beforeSend: function() {  },
>         success: function(resp) {alert("GOT IT");}
>
> });
>
> This way the success function is never called. I've checked with
> firebug net console: all server responses do come back to the browser.
>
> Once I remove
>
> cache:  false
>
> line, all works fine.
>
> Could someone please explain me what am I doing wrong? Thanks in
> advance.
>
> Regards,
> Juriy

Reply via email to