hi  Benjamin,
  It's very nice for your reply.Thanks a lot!Your advice does help
me,but i have another problem.
  If i don't like the php file to display the data.Because if someone
who view the js source will see the url and can request the url in the
navigator and get the data.Can i just return  json but not display it.

Thanks

On 7月11日, 上午10时46分, "Benjamin Sterling"
<[EMAIL PROTECTED]> wrote:
> Xinhao,
> Welcome to the list;
>
> The way I usually do it is something like this:
>
> php (returns json):
> echo '{id:1,fname:"Benjamin",lname:"Sterling"}';
>
> javascript:
>
> $.ajax({
> dataType:'json',
> url:'mypage.php',
> success : function(info){
> // do something with with "info"
> // call return by doing something like
> // info.id / info.fname / info.lname
>
> }
> });
>
> This should point you in the right direction.
>
> On 7/10/07, Xinhao Zheng <[EMAIL PROTECTED]> wrote:
>
>
>
> > hello everyone,
> >   I am just a fresher to jQuery.I like it very much.I need some help.
>
> > Is there any way to request a php file to fetch data from db in jQuery
> > then operate on it use  js?Ajax can do it?
>
> > which format would be the best way to return the data,json or xml?how to
> > deal with that in js?
>
> > I just want to implement a calendar and display data from db.
>
> > Thanks
>
> --
> Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com

Reply via email to