Fixed it!

Once I realized it was working on Firefox/Win XP, but not IE7/Win XP,
I did some more googling on this group, and found this post:

http://groups.google.com/group/jquery-en/browse_thread/thread/a40b6fb572232e3b/662932a169dd4e14?lnk=gst&q=%24.ajax()+firefox+ie7#662932a169dd4e14

Andy K:

> This is due to the IE implementation of XMLHTTP being a little over-
> enthusiastic about using cached copies instead of going back to the
> server for each request.

Jesse R.:

> Yeah, this is exactly what the problem was.  I managed to type in the
> right search string finally and found the answer in here.  I actually
> decided to use $.post for my json request and IE does not cache POSTs.

Using $.post() instead of $.ajax() or $.getJSON() fixed it.

For reference for anyone trying this out, here's the skeleton code.

JQUERY:
        $.post("/myFunction", {variable1: 'TestVariable'}, function(data){

                var data = JSON.decode(data);  //uses json_min.js plugin

                //use data
        });


PHP:
        //put data to be retuned into array called $theData

        $S = $this->json->encode($theData); //uses a jason encoder - which
one depends on your development environment

        echo $S;

        return;

Reply via email to