0

I am using the following code to fetch templates from my server and display them to the user:

ta.loadTemplate = function(template, $container) {
  $.ajax({
    url: "/templates/" + template + ".tempo",
    async: false,
    dataType: "text",
    success: function(data, status, xhr) {
        $container.empty().html(data);
    },
    error: function(obj, status, error) {
         ta.load404('Template '+template+' not found. Error: '+status+"\n\nResponse: "+error);
    }
  });
};

ta.load404 displays the 404 page template and sends me an email with the error message.

This code has been working fine for a while, but suddenly in the last couple days, I've had users get stuck in an infinite loop where it is unable to load the 404 template and just keeps looping. The error I'm receiving in my email is:

NETWORK_ERR: XMLHttpRequest Exception 101

I tried researching this, but it seems this problem seems to arise when requesting a local file using the file:// protocol. However, as you can see, I am not doing that.

The server is running on JBoss. Does anybody have any ideas on why else this network error would occur? Is there any reason this problem would arise

Ry-
  • 218,210
  • 55
  • 464
  • 476
  • Did you change domains recently? – Ry- Jan 11 '12 at 22:01
  • I did, about a week ago. Why would that be an issue? – Neil Gupta Jan 11 '12 at 22:07
  • Check your code over for absolute paths pointing to your old domain. Those are almost certainly the cause of the problem. Just search for `http://` in every .js file on your server. – Ry- Jan 11 '12 at 22:07
  • I just double checked it, there are no absolute paths anywhere. Also, if that were the case, I imagine this would consistently fail? – Neil Gupta Jan 11 '12 at 22:11
  • Yes, it would consistently fail; but only when actually used. For example, if the problematic code is only used when logging in, and you never log in, you will never experience the problem. – Ry- Jan 11 '12 at 22:12
  • I am specifying dataType to "text" for the .tempo file types. These just contain HTML code that gets rendered using the Tempo rendering engine. However, I don't actually specify their mime type anywhere. Would that cause an issue here? – Neil Gupta Jan 11 '12 at 22:13
  • Does tempo read it as XML? See the last answer on this question: http://stackoverflow.com/questions/2235929/network-error-xmlhttprequest-exception-101 – Ry- Jan 11 '12 at 22:16
  • This code is used with every single page load and has only failed for 2 users so far (since the new code was deployed on a new domain last week), so the rate of failure is actually relatively low and seemingly random. – Neil Gupta Jan 11 '12 at 22:16
  • No, tempo should be reading it as a text string. Plus, this error is thrown before it ever even reaches Tempo. – Neil Gupta Jan 11 '12 at 22:17
  • If it's only 2 users and not consistent, it might just be their own network error, then. – Ry- Jan 11 '12 at 22:18
  • I considered that, but they too are able to access most pages, so even for them, it's random. This code is from an in-class discussion tool, so all users are on the same network. These 2 users are using different, but up-to-date browsers (Safari and Chrome so far, so maybe a Webkit bug?) – Neil Gupta Jan 11 '12 at 22:21
  • Since the start of this semester (3 days ago), I've had 2 users get stuck in this infinite loop, which caused me to receive 700 error emails at once. This is out of about 150 users on the service so far, so relatively low but still high enough to cause concern. As far as I can tell, those are the only 2 instances. I've updated my server configuration to serve .tempo files with a text/plain mime type. – Neil Gupta Jan 11 '12 at 22:32

0 Answers0