Safari is experiencing a unique DOM Exception 11 error when making XHR requests

In my code, I have a function that is responsible for downloading chunks of a file using an xhr request. The function is structured like this:

var blobXHR = new XMLHttpRequest();

//api.media.chunkURL() returns the correct URL for each chunk
blobXHR.open("GET", api.media.chunkURL({
            fileId: fileID,
            chunkId: chunkNumber
            }));

blobXHR.responseType = "arraybuffer";

blobXHR.onerror = function (e) {
            console.log("Error: ", e);
            };

var arrayBuffer;
blobXHR.onload = function (e) {
            arrayBuffer = blobXHR.response;
            };

blobXHR.send();

This download function runs smoothly on Chrome, Firefox, and most Android browsers. However, I encounter a vague error specifically on Safari and iOS browsers within the blobXHR.onerror() function. The error message I receive is:

Error: InvalidStateError: DOM Exception 11

Despite researching similar issues, I have not found a solution that works for me. Can anyone shed light on why this problem is occurring only on Safari and iOS browsers?

Additional note: When I console.log(blobXHR) within onerror(), I get the following output:

https://i.sstatic.net/PJ3Pp.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to dynamically update the text in an HTML element with a randomly generated value using JavaScript?

Currently, I am working on a coding project where I am attempting to create a flip box that reveals the name of a superhero from an array when clicked by a user. The code pen link provided showcases my progress so far: https://codepen.io/zakero/pen/YmGmwK. ...

I'm baffled by why I keep receiving the error message "Unknown provider: $routeProvider <- $route <- AppController" in AngularJS, even though I have already

I've exhausted all the solutions I found on stackoverflow without success. Apologies if this is a duplicate question. My goal is to reset the content of my Bootstrap table with a button click using the function $route.reload(). However, when I includ ...

The AJAX request I'm making is not behaving as I anticipated when returning JSON data

I'm currently working on building an ajax call to compare my database and automatically update a div if any changes are detected. JavaScript is still quite new to me, especially when it comes to dealing with JSON data. I suspect the issue lies in ho ...

Require help with personalizing a jQuery horizontal menu

I recently downloaded this amazing menu for my first website project By clicking the download source link, you can access the code Now, I need your kind help with two issues: Issue 1: The menu seems to be getting hidden under other elements on the page ...

reducing the dimensions of the expanding panel in Material UI

I am facing a challenge which requires me to reduce the size of the expansion panel when it is open or expanded. I checked the elements and styles tab, but it seems that we need to override the styles. Has anyone dealt with this scenario before? Here is a ...

When using electron-build, the node-adodb encountered an error stating: 'Failed to spawn C:WINDOWSSysWOW64cscript.exe'

Utilizing node-adodb.js for reading .mdb files with the following code: const db = require('node-adodb') ipcMain.on('query', (e, p) => { if (!p) return appendFileSync('a.log', new Date().getTime() + ' ' + p.t ...

Custom error messages for data types in Ajv

Recently, I delved into using Ajv with ajv-errors to validate JSON schema and generate personalized error messages. While everything is functioning correctly so far, I encountered a challenge in setting custom error messages for individual values based on ...

The HTML code as content

While working on an AJAX project, I ran into this issue: http://jsbin.com/iriquf/1 The data variable contains a simple HTML string. After making the AJAX call, I noticed that the returned string sometimes includes extra whitespaces. I attempted to locat ...

Changing the Navigation Bar Color in iOS with Dynamic Dark Mode

Currently, I am working on incorporating a toggle feature for dark mode in my application. The main objective is to switch the navigation bar color to black once the UIViewController is visible on the screen. While I am familiar with how this can be achiev ...

Filtering deeply nested arrays

Hey, I'm working with this interesting array: [ { "Navn": "Long Island Iced Tea", "Nummer": "2", "Glas i ml": "250", "Instruktioner": "", "a": "Hæld is i glasset", "b": "pynt med en skive lime", ...

Activate and deactivate form fields on Safari

I have been working on a script to enable and disable a field using Javascript. It functions correctly in Internet Explorer, but I am encountering issues with Safari. FIELD If "Yes" is selected, the free text field below should be enabled; otherwise, it s ...

Displaying all items in a collection as HTML using Node.js

I am looking to showcase all the items in my mongodb collection as HTML. In the past, I have accomplished this with simpler tasks, such as... router.get('/', function (req, res) { res.render('home', { title: 'Express', u ...

vuex: The decision between using $store.commit and directly calling the function

Recently, I discovered an interesting technique where store mutation functions can be passed into HTML events. Here's an example: //In the template <input name="the_field" :value="the_field" @input="updateField"/> // In the component methods ...

Editable content area: Maintain and restore cursor position when placed on a blank line

While working with a contenteditable div and constantly updating the HTML as the user types, I am facing the challenge of saving and restoring the caret position. I came across a helpful solution provided by Tim Down on a similar issue, which I found on S ...

Could someone review my coding syntax in JavaScript for utilizing indexOf, split, and looping through multiple inputs to paste the splits?

As someone who is self-taught and codes part-time as a hobby, I am currently working on building a JavaScript/jQuery tool. This tool will allow users to copy rows or columns from Excel and paste them into an online HTML form consisting of a grid of <tex ...

Schedule: acquire specific date elements, strange scenario

Trying to investigate the peculiar behavior of this code snippet. Details provided below: let nowDate = Date() let threeDayBeforeNowDate_t1 = Date(timeIntervalSinceNow: -60 * 60 * 24 * 3) let oneDayAfterNowDate = Date(timeIntervalSinceNow: 60 * 60 * 24 * ...

Tips on moving a square along the z axis in three.js

Can anyone provide assistance with translating a square on the z axis in three.js? I would appreciate any examples or guidance on the best approach to achieve this. ...

Error: The term "Particles" has not been defined

I'm attempting to integrate code from a website into my project, but encountered an error when the particles failed to run after adding it. I downloaded and installed particle.js from "https://github.com/marcbruederlin/particles.js/issues" for this pu ...

Issues with jQuery fundamentals

For a while now, I've been grappling with jQuery. It's undeniably powerful and offers a plethora of fantastic capabilities. However, my struggle lies in the fact that I tend to incorporate multiple jQuery features simultaneously. For example, on ...

Starting service upon startup in Angularjs

I am looking to retrieve configuration data from the server and store it in the global scope within my AngularJS application. My app operates in multiple modes such as development and production, with different external services being used depending on the ...