views:

71

answers:

1

Note: This relates to a previous question.

I have a Wicket page that has a form with some complex client-side interactions that I decided to use jQuery for instead of Wicket (long discussion, I know). Essentially I'm just building a JSON object, submitting it via AJAX, and performing some action on completion. The call works fine in Firefox, but not in any version of IE. I've already verified that there are no extraneous commas. Here's the code:

var lookup = {
    'name': name,
    'description': description,
    'items': [{
        'name': itemName,
        'value': itemValue
    }]
};

$.ajax({
    type: 'post',
    url: '${callbackURL}', // This file is parsed by Wicket and receives a dynamic callback URL here. This is not jQuery!
    cache: false,
    data: {'lookup': JSON.stringify(lookup)},
    contentType: 'application/json',
    complete: function() {
        alert('This never gets called in IE!')
    }
});

Any suggestions? Thanks!

Update: It appears my problem is due to IE caching the resources. I've put no-cache code in my HTML file, but it seems that either the page is still getting cached (and by extension, the JS it references), or the JS file with my jQuery code in it is being cached with the old callback URL in it so that the server doesn't respond because there's nothing at that URL anymore. When I remove the pretty URLs everything works fine (because every time Wicket generates the URL, it's unique). Still, shouldn't the complete function get called even if there's no server response?

A: 

Can you post the code you're using to make the AJAX call, and can you clarify how it doesn't work in IE? Is the call AJAX request not being made in IE, is the request returning an error, is there an issue handling the response?

Usually this would be attributed to extraneous commas, but you've already ruled them out so I think more information is required in order for us to assist.

Zam
You can try adding a dataFilter parameter to your call, to see if its a parsing error of some sort (although I'd expect the the error handled to be invoked. You can also try adding in a timeout to the request. It's possible that something is preventing IE from receiving the entire response, in which case you would get a timeout error
Zam