Depending on your version of PHP, the module may come installed as
standard so you'll just need to uncomment the line from your php.ini
and restart (http://uk2.php.net/manual/en/json.installation.php).
Although I'd make sure that wherever you're hosting the app in the end
will have the module enabled.

It might be easier just to write the JSON explicitly though, it
doesn't look like your code is especially complex.



On Aug 27, 5:42 pm, sso <strongsilent...@gmail.com> wrote:
> its not installed, the functions break the script and I'm now aware
> that this isn't obvious when its done in an ajax call :)  thanks!
>
> On Aug 27, 12:22 pm, Leonard Martin <leonard.mar...@gmail.com> wrote:
>
> > Have you also tried accessing your PHP page directly and copying it's
> > output intohttp://www.jsonlint.com?
>
> > I'd also double check your server has the JSON module for PHP
> > installed, just to be sure ;-)
>
> > On Aug 27, 4:45 pm, MorningZ <morni...@gmail.com> wrote:
>
> > > I would suggest using Firefox and FireBug to "watch" what comes back
> > > from your $.getJSON call... because that will indicate that your JSON
> > > is indeed valid, because if it isn't, you'll never make it into the
> > > success event
>
> > > On Aug 27, 11:01 am, sso <strongsilent...@gmail.com> wrote:
>
> > > > I need to return several values and I'd rather do it all in one ajax
> > > > call.  However there doesn't seem to be anything in data.  Perhaps I'm
> > > > way off here.
>
> > > > I appreciate any guidance you can give me.  Thanks :)
>
> > > > This is my jquery
> > > >         $('#cart-pulldown').livequery('click', function(event){
> > > >                 $.getJSON(siteurl + "home/aj/showCart/", {},
> > > >                         function(data){
> > > >                                 alert(data);
> > > >                         });
> > > >         });
>
> > > > This is the ajax in my PHP
> > > >                                 $tmp = "";
> > > >                                 foreach($_SESSION['cart'] as $key 
> > > > =>$line){
> > > >                                         $tmp .= $key . " ..... " . 
> > > > $line . "<br />\n";
> > > >                                 }
> > > >                                 $tmp .= '<div><span 
> > > > id="clearList">Clear List</span></div>';
> > > >                                 echo json_encode($tmp);

Reply via email to