Well because it is an object.If you using firefox you should try
alert(data.toSource()); after you've done the eval.

But also to keep in mind like Liam Potter suggested you should use $.getJSON
and you wont have to do the eval.

Thanks & Regards,
Dhruva Sagar.


Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
- "I'm willing to admit that I may not always be right, but I am never
wrong."

On Wed, Aug 12, 2009 at 3:27 PM, Mark <johanns.m...@gmail.com> wrote:

>
> yeah that i was thinking to but the problem is that you get.
>
> [object Object]
>
> if you alert out data again.
>
> On Aug 12, 11:53 am, Dhruva Sagar <dhruva.sa...@gmail.com> wrote:
> > I think this is what you are looking for
> >
> > data = eval ( '(' + data + ')' );
> >
> > Thanks & Regards,
> > Dhruva Sagar.
> >
> > Jonathan Swift<
> http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html>
> > - "May you live every day of your life."
> >
> > On Wed, Aug 12, 2009 at 3:18 PM, Mark <johanns.m...@gmail.com> wrote:
> >
> > > Hi all.
> > > I got an php page who picks up data out of my data base and puts it in
> > > a multidimensinal array. That array is being encoded to Json
> >
> > > $event = json_encode($super_array);
> >
> > > Then i made an javasript get funtion to get that array to my main
> > > page.
> >
> > > function get(){
> > >                 $.get("../position of my file/test.php",
> function(data){
> > >                        alert (""+data);
> > >                        });
> >
> > > The var data doesn't give me an array it gives me an object while i
> > > programmed it to give me an array (inplace of force_object):
> >
> > > {"5":
> >
> > >
> {"id":"5","title":"test","start_datum":"6161616","end_datum":"663461","afspraak_type":"memo"},"10":
> >
> > >
> {"id":"10","title":"bla","start_datum":"4819028","end_datum":"8230948","afspraak_type":"verjaardag"}}
> >
> > > What i need to have is that it gives me an array that looks something
> > > like this:
> >
> > > [
> > >  {
> > >     id:5,
> > >     title:test,
> > >     start_datum:6161616,
> > >     end_datum: 663461,
> > >     afspraak_type: Memo
> > >  }
> > >  {
> > >     id:10,
> > >     title:bla,
> > >    start_datum: 4819028,
> > >    end_datum:8230948,
> > >    afspraak_type:Verjaardag
> > >  }
> > > ]
> > > What is the best way to get to this?
> >
> > > Mark
>

Reply via email to