Hi benjamin,

Thanks for your fast reply. Thanks for explaining things ... If I
understand it correct data is something $.post created right?

Things now make sense.

james

On Jul 12, 10:32 am, "Benjamin Sterling"
<[EMAIL PROTECTED]> wrote:
> James,
> In:
> $.post('test.cgi', params,
>    function(data) {
>        alert(data);
>    }
> );
>
> where data that is being passed thru the function to the alert is the
> argument that the $.post function is passing it.
>
> and:
>
> $.post('test.cgi', params, alert(data));
>
> where data, if not set, will alert undefined since that argument being
> passed back from $.post is not called data (as far as I know).
>
> If you wanted to do:
>
> $.post('test.cgi', params, alert(data));
>
> then do:
>
> $.post('test.cgi', params, alert(arguments[0]));
>
> But I would guard against that since you loose flexibility.
>
> Let me know if this does not make sense.
>
> Ben
> On 7/11/07, james_027 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi,
>
> > I am using $.post() function, I don't understand what is callback
> > function ...
>
> > what is the difference between
>
> > $.post('test.cgi', params,
> >     function(data) {
> >         alert(data);
> >     }
> > );
>
> > and
>
> > $.post('test.cgi', params, alert(data));
>
> > the data being shown is different. and I don't seem to understand what
> > is the difference in function(data) {alert(data);} from alert(data).
> > For me function(data) {alert(data);} is just a function taking the
> > data and just passing it to the alert(). Is function() inside the
> > $.post something special? where does the data come from? are the data
> > in the function(data) {alert(data);} and alert(data) different?
>
> > Thanks
> > james
>
> --
> Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com

Reply via email to