Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

XMLHttpRequest issues

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

XMLHttpRequest issues

Post by mcrossley »

Normally when I use the XMLHttpRequest object to perform a 'get' with javascript I use something like the following to check the response:

Code: Select all

if (objXML.readyState === 4) { //complete?
  if (objXML.status === 200) {
    //do something
  } else if (objXML.status > 200) {
    //retry
  }
}
In the past XMLHttpRequest.status has always returned an integer/number
Status1.JPG
but I a now seeing a problem where the .status seems to be an error object!
Status2.JPG
which of course messes up the above code - it creates an exception on the first test of status as I am performing a strict comparison.

As a work around I will change to loose comparison, but I cannot find any reference to this via Google. Anyone else seen it before?
You do not have the required permissions to view the files attached to this post.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: XMLHttpRequest issues

Post by beteljuice »

That's a JS 'stackoverflow' from IE9 http://www.google.co.uk/search?q=error+ ... utf-8&aq=t
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: XMLHttpRequest issues

Post by mcrossley »

doh! now why didn't I Google the error code! :bash: :bash:
For those who are interested in what the problem was: it shows up because an
aborted request comes through with a readyState of "4", which is the same
state as "successful", and we were processing it as such (intentionally - we
check later for successful completion). However, in IE9, when you abort
during an unload, the status, etc, doesn't get set properly, and when you
try and read it an exception is thrown.
So it looks like the request is taking too long and my abort code kicks in creates the problem. I'll look at fixing it...
Post Reply