0

I have a fairly complicated page built using JSP, JavaScript, jQuery, and css. It works fine in Chrome, Firefox, and IE10. However, it doesn't work in IE8 - JavaScript specific to that particular page doesn't load, the HTML is broken, some css is loaded, but not all.

The page called via an AJAX call:

jQuery.ajax({
            url : url,
            dataType: "html",
            cache : false,
            beforeSend : ...

Capturing network activity in Developer tools shows that the relevant script files have started to arrive, but only 155B-157B were received. Result code is 304, time is shown as under 1ms. Same reporting for Chrome shows that the same JS files are 3-7-12KB in size, took 3-10ms to arrive, with HTTP code 200.

The same page requested via a regular GET request loads normally. The problem looks like a known aggressive-caching issue in IE8, but somehow setting cache : false doesn't prevent 304 from happening.

How can I make this work?

Using jQuery version 1.4.2, IE8 on Win7. tc Developer server 2.8.2.

19
  • "What is the difference in JS processing between IE8 and IE10" <- Where to start, just about everything !
    – adeneo
    Dec 11, 2013 at 17:07
  • adeneo: do post links. I've gotta start somewhere.
    – jprusakova
    Dec 11, 2013 at 17:09
  • you can try looking for syntax problems inside this specific page. ie8 cant deal with HTML syntax problem like modern browsers. Dec 11, 2013 at 17:11
  • Have you checked for errors in the IE8 developer console?
    – Pointy
    Dec 11, 2013 at 17:13
  • 1
    @jprusakova which version of jQuery are u loading? Dec 11, 2013 at 17:18

1 Answer 1

0

One of the JavaScript files being retrieved via the AJAX call contained, among other code, this method:

    jQuery(document).ready(function() {
    return validate...();
}

IE8 was not able to process it, and discarded all surrounding JavaScript.

I removed the lines above, and moved the validation method to the function that was called on Complete: of that AJAX call, and everything started working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.