« Return to Thread: ajax post not sending header
Re: ajax post not sending header
I forgot to mention that on the same page I have $('#loadit').load('/
load/url/') and it works fine, so the problem is only with post.
On Jul 2, 5:32 pm, hadaraz <hada...@...> wrote:
> Nop, it is the same...
>
> On 2 יולי, 00:17, James <james.gp....@...> wrote:
>
> > Hmm...
>
> > What happens if you add:
> > type: "POST"
>
> > in your AJAX options?
>
> > On Jul 1, 10:36 am, hadaraz <hada...@...> wrote:
>
> > > I have used firebug, and there is no sign of AJAX request.
>
> > > On the server side I use python, and yes, I'm checking for
> > > 'HTTP_X_REQUESTED_WITH'. Maybe there is a problem with the jquery
> > > 1.3.2 (which is what I use, linked from google ajax libs)?
>
> > > On Jul 1, 9:21 pm, James <james.gp....@...> wrote:
>
> > > > Have you tried using Firebug for Firefox to examine the headers of the
> > > > AJAX request to be sure that it wasn't sent? Check that first.
>
> > > > You might be reading the headers incorrectly on the PHP side. Are you
> > > > using: $_SERVER['HTTP_X_REQUESTED_WITH']
> > > > The beginning HTTP_ part is the tricky part. Make sure you have that.
>
> > > > On Jun 30, 9:52 pm, hadaraz <hada...@...> wrote:
>
> > > > > Posting data from a form using this function:
>
> > > > > $(function() {
> > > > > $('#emailform').submit(function() {
> > > > > $.ajax({
> > > > > url: '/post/url/',
> > > > > dataType: 'json',
> > > > > data: $('#emailform').serialize(),
> > > > > success: function(rdata) {
> > > > > $('#emailformmessage').text(rdata.message).show
> > > > > ('slow');
> > > > > }
> > > > > });
> > > > > });
> > > > > return false;
>
> > > > > });
>
> > > > > the server doesn't detect an ajax call ('X-Requested-With' header is
> > > > > not sent). I tried forcing it with beforeSubmit and also with
> > > > > ajaxSetup, but no go.
> > > > > Any solutions to this problem?
>
> > > > > hadaraz-הסתר טקסט מצוטט-
>
> > -הראה טקסט מצוטט-
« Return to Thread: ajax post not sending header
| Free embeddable forum powered by Nabble | Forum Help |