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?

Community
  • 1
  • 1
Jared
  • 1,254
  • 7
  • 19
  • 26
  • It'd help a lot to post the code in question. Have you determined whether the HTTP request actually occurs? Have you stepped through it with the IE8 debugger? – Pointy Jul 12 '10 at 15:59
  • Sorry for not posting the code initially. I had to leave in the middle of posting my question and just wanted to get it out there. The AJAX request is being made (I'm persisting data successfully from the request), but the callback never gets executed. No exceptions are thrown (I've wrapped the call in a try/catch and never made it to the catch), and I've added `error: function(request, status, err) { ... }` to the $.ajax() call and verified that no error is returned there. – Jared Jul 12 '10 at 17:45

1 Answers1

0

This was due to aggressive IE caching. It was resolved by adding a uniquely generated parameter to the URL so the browser would think it's a new URL every time.

Jared
  • 1,254
  • 7
  • 19
  • 26