Bug Tracker

Ticket #9466 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

$.ajax working in FF and Chrome, but not in IE8

Reported by: amit.mangal@… Owned by:
Priority: low Milestone: 1.next
Component: ajax Version: 1.4.4
Keywords: Cc:
Blocking: Blocked by:

Description

Hi,

I am trying an ajax call for recaptcha validation and the code works fine in FF and Chrome, but it gives a 'Invalid Argument' error in IE8. I tried the 'complete(jqXHR, textStatus)' method, and it gave the same error. My Method:

function submit(form, callback, format) {
    $.ajax({ url: form.action,
        type: form.method,
        dataType: format,
        data: $(form).serialize(),
        success: callback
    });
}

where form.action is empty, form.method = post and format is html. callback is a method 'validateRecaptcha(result)' with the result of call passed as argument.

The call simply fails with an 'Invalid Argument' error. Just for FYI, I am using an MVC framework.

Regards, Amit Mangal

Change History

comment:1 Changed 3 years ago by amit.mangal@…

I just came to know about fiddler, and used it. come to be that the call isn't happening at all.

comment:2 Changed 3 years ago by amit.mangal@…

Hi,

I have found the issue. Apparently removing the 'url' parameter solved the problem, so when IE said 'Invalid Argument', it literally meant that, though the parameter is supported by ajax function I have called, so I don't know why is that. May be because of a conflict of jquery files in my solution, but that just a wild guess.

Thanks Anyways, Amit

comment:3 Changed 3 years ago by addyosmani

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to ajax

Thanks for submitting a ticket to the jQuery Project. It's possible that the value you're passing to 'url' (ie, through form.action) is either not a valid string or is simply just empty (you mention this, however I'm unsure of whether you're really passing nothing through to ajax as a url - this well could cause errors to be output). As there doesn't appear to be anything wrong with the code you've submitted (and you appear to believe the fault is on your side), I'll be closing this ticket as invalid. Once again, it's probably a good idea to double check the value of form.action.

comment:4 Changed 3 years ago by amit.mangal@…

Hi,

Thanks for the response. I had checked the value of form.action, and it was an empty string (also mentioned). Also, 'url' is a parameter supported by ajax method, so I do not know where the problem was. About fault being mine, I just said that may be because of multiple jquery files in my solution project there is an error (though checked for this too using noConflict(), and result was still the same). So, I do not know why IE8 was giving 'url' as invalid parameter and felt it was somehting to do with JQuery version I am using and thus the ticket request. But as you mentioned, there was no problem with that, just IE8 behaving differently.

Anyways, I do not need the 'url' paramter so the problem is solved for the moment, though I understand the solution is invalid and so would still want to know why it was not working.

Thanks for assistance.

Regards, Amit

Note: See TracTickets for help on using tickets.