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.

jprusakova
  • 1,557
  • 3
  • 19
  • 31
  • "What is the difference in JS processing between IE8 and IE10" <- Where to start, just about everything ! – adeneo Dec 11 '13 at 17:07
  • adeneo: do post links. I've gotta start somewhere. – jprusakova Dec 11 '13 at 17:09
  • you can try looking for syntax problems inside this specific page. ie8 cant deal with HTML syntax problem like modern browsers. – Iliya Reyzis Dec 11 '13 at 17:11
  • Have you checked for errors in the IE8 developer console? – Pointy Dec 11 '13 at 17:13
  • 1
    @jprusakova which version of jQuery are u loading? – Yuriy Galanter Dec 11 '13 at 17:18
  • @Pointy I am working with Developer Tools console, and the only error I get is 'null or undefined property', that refers to a JS function. – jprusakova Dec 11 '13 at 17:26
  • @IliyaReyzis how do I look for syntax problems? I'm using at Dev.Tools console, and also consoles in other browsers. It looks clean. – jprusakova Dec 11 '13 at 17:27
  • post the function that is giving the error – Ronnie Dec 11 '13 at 17:43
  • I'm guessing there's something in that function (or one before it in the script) that IE8 can't do. Can you post that code (or even a link to the broken page) so we have something, anything, to go on? – Olly Hodgson Dec 11 '13 at 17:50
  • @Ronnie added code to the question. – jprusakova Dec 11 '13 at 17:50
  • ok, now that we can see the function in question, the error console should point to a line number. Can you point that out for us? Also, what is that `...` ? – Ronnie Dec 11 '13 at 17:52
  • @OllyHodgson the page is on the closed site, and there is too much code 'before it' to post... Any suggestions what kind of thing(s) could be the problem? – jprusakova Dec 11 '13 at 17:52
  • @Ronnie: executeEnrollmentOnReady, in second code line from the bottom, is the object that's not loaded. – jprusakova Dec 11 '13 at 17:53
  • IE doesn't like comma-terminated lists: `a = [1,2,3,];` Don't see that issue in the above code though. – Jim Cote Dec 11 '13 at 17:57
  • @JimCote thanks. I don't have any comma-terminated lists... – jprusakova Dec 11 '13 at 18:13
  • What happens if you disable caching on your server so it serves the full content instead of the 304? Does it still break under those conditions? If so you can at least rule out the 304 thing. – Dagg Nabbit Dec 11 '13 at 21:47
  • @DaggNabbit cache is set to false in the request. Should not it disable caching? In other browsers, the full content is delivered with status 200, and everything works great. – jprusakova Dec 11 '13 at 22:30
  • @jprusakova the 304 certainly implies that the server thought the client already had a copy and should just use that copy. I was suggesting disabling caching *on the server*, just to see if the 304 thing is even relevant to the issue (I suspect it might not be). – Dagg Nabbit Dec 11 '13 at 22:33
  • @DaggNabbit how to disable caching on the server? TomCat on Win7: tc Developer Edition 2.8.2. – jprusakova Dec 12 '13 at 17:11

1 Answers1

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.

jprusakova
  • 1,557
  • 3
  • 19
  • 31