Friday, January 15, 2010

[jQuery] Re: Bad jQuery post

I was hoping to try your suggestion, but there is a syntax error after
the ,dataType: "html".
}
dataType: 'html'
});

});

The error reads "Missing } after list. I'll see if I can find it by
serching the API documentation.
Thanks for your help.
J M

On Jan 16, 12:52 am, lfortin <laurent.for...@gmail.com> wrote:
> Hi JamaicaMan,
>
> First, the parameter 'json' seems to be useless, since it is passed in
> the .click() event binder.
>
> And a request like this one should work:
>
> $("#donateButton").click(function () {
>
>    $('#rightContent').html(ajax_load);
>    $.ajax({
>      type: 'POST',
>      url: 'content/creditCardAuthorize.php',
>      data: {
>         amount: $('#amount').val(),
>         description: $('#donation').val()
>      },
>      success: function(html){
>         $('#rightContent').html(html);
>      }
>      dataType: 'html'
>    });
>
> });
>
> Also, be sure that your text inputs really have id="amount" and
> id="donation", because you access them with the id selector: $
> ("#element"), not with the input names.
>
> Hope it helps,
>
> -Laurent
>
> On Jan 16, 1:19 am, JamaicaMan <williambradley.ro...@gmail.com> wrote:
>
>
>
> > I have a jQuery post problem.  I am sending information from a form
> > with a jQuery click function. I am loading the response from one form
> > that is a DIV called rightContent to the same DIV and pass the
> > information along.
> > The problem is that on some browser it process the way I would expect,
> > goes to the correct page, but on others it goes to the home page, or I
> > should say it does an ajax_load of the home page.
>
> > IE 8 works
> > FireFox works
> > Chrome goes to home page
> > Safari goes to home page
>
> > I am not sure of where to start looking for the problem.  Any
> > suggestions?
> > Thanks!
>
> >             $("#donateButton").click(function (){
> >                 $.post("content/creditCardAuthorize.php",
> >                 {
> >                     amount: $('#amount').val(),
> >                     description: $('#donation').val()
> >                 });
> >                 $('#rightContent').html(ajax_load).load('content/
> > creditCardAuthorize.php');
> >             }, 'json');- Hide quoted text -
>
> - Show quoted text -

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate