Encountering an Invalid Argument Script Error while using Internet Explorer 11 on Windows 10

I encountered an issue with an Invalid Argument script error in Windows 10 using IE 11. However, the code runs smoothly on Windows 7. Please refer to the attached screenshot and see if anyone can offer assistance. Here is the code snippet:

var tbl = document.getElementById('packageMaterial');
var lastRow = tbl.rows.length;
var row = tbl.insertRow(lastRow);
var td1 = row.insertCell(0);
var td2 = row.insertCell(1);
var td3 = row.insertCell(3);
td1.innerHTML = "test1";
td2.innerHTML = "test2";
td3.innerHTML = "test3";

The problem seems to be that I am missing two arguments in creating the cell. Although this code functions correctly in a Windows 7 environment, it triggers an Invalid Argument script error in Windows 10's Internet Explorer 11. Please see the error details in the attached screenshot.

https://i.sstatic.net/Djm0f.jpg

Answer №1

Your code has an issue that needs to be addressed.

Try using row.insertCell(4) instead of var tdAvailQty = row.insertCell(3); and var tdPkgId = row.insertCell(5);

It seems in Windows 10 IE 11, you must insert table columns in sequence. You are inserting cells 0,1,2,3, and then skipping 4 and going straight to 5.

To fix this problem, add row.insertCell(4) before moving on to cell 5.

I hope this solution is helpful for you!

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

Unraveling the Perfect Jest Stack Trace

Currently, I am in the process of debugging some tests that were written with jest using typescript and it's causing quite a headache. Whenever a test or tested class runs Postgres SQL and encounters an error in the query, the stack trace provided is ...

What potential issues can arise when importing a default export alongside a named export and using webpack in conjunction with babel?

I have two distinct constructors in my codebase: SignUp and GoogleSignIn. They are structured as follows: import SignUp, {gapi_promise} from "./SignUp"; /** * * @param element * @extends SignUp * @constructor */ function GoogleSignIn(element){ SignUp ...

jquery accordion set to collapse by default when the page first loads

Currently, I have integrated JQuery UI accordion into my webpage and I am facing a minor issue. Upon page load, all tabs are initially open for a few seconds before collapsing. I suspect this might be a loading effect. Any suggestions on how to ensure that ...

When troubleshooting the "Uncaught reference error: require is not defined," the browserify command encountered the error message "Error: Cannot find module."

I am encountering a similar issue to @RachelD in the thread discussing the Uncaught reference error. When I execute the 'browserify' command following the instructions provided here, and using my directory as a reference, like so... myname@compn ...

Learning how to update a database using AJAX, jQuery, PHP, and MySQL can greatly enhance your web development

I am facing an issue with updating a database using AJAX without reloading the page. Even though I receive a success message after making the AJAX call, the database is not getting updated as expected. Here is my code: JS: $('.start-time-class' ...

ESLint's no-unused-vars rule is triggered when Typescript object destructuring is employed

I'm encountering an issue with my Typescript code where I am destructuring an object to extract a partial object, but it's failing the linter check. Here is the problematic code snippet: async someFunction(username: string): Promise<UserDTO> ...

Switching a Rails/Ajax form from create to update mode upon submission

While experimenting with a star ratings page, I encountered an issue where the form element remained in "Create" mode instead of updating to an "Update" method after submission. The rating form is ajaxified, but it lacks the functionality to dynamically sw ...

JavaScript Database Operations

I have a script that reads data from a Google Sheet and returns its content. I am looking to save all of this data into a database. var request = gapi.client.sheets.spreadsheets.values.get(params); request.then(function(response) { console.log(respons ...

How can I protect my jQuery script from being accessed by "FIREBUG"?

I was tasked with creating a jQuery script as follows: function DeleteFile(_FileID) { //ajax method to delete the file } The FileID is stored in the 'rel' attribute of the list. However, when I call "DeleteFile" from Firebug using the fileId ...

Tips for navigating through complex JSON structures with JavaScript or JQuery

I'm currently navigating the complexities of parsing a multi-level JSON array as a newcomer to JSON. I am seeking solutions using either JavaScript or jQuery. My goal is to extract the application id, application description, and Product description f ...

Encountering an error message stating "TypeError: Unable to access properties of undefined (reading 'map')" while attempting to retrieve data

Having a React frontend, I am encountering an issue when trying to fetch data from my Node.js backend. Despite having the API structured correctly, I am facing difficulties. const SingleProductPage = () => { const { productId } = useParams(); cons ...

Ensure that the authorization header is properly set for all future client requests

I need help figuring out how to automatically set the "Authorization: Bearer ..." header for user requests. For example, I save the user to the database, generate a token, and send a welcome email with the token : await user.save() const token = await use ...

Issues with reading d3.js visualization data from a JSON file

I am currently working on a data visualization project using D3.js and I started with a basic framework that I found on this link The data for my visualization is coming from a json file containing only two values, a string value and an integer. However, ...

Is there a way in PHP to establish a database connection only once and reuse it multiple times via Ajax calls in JavaScript?

My current setup involves using Ajax to request a remote PHP file for accessing the database. However, every time I make a request, the connection is re-created. Is there a way for me to create the connection just once and reuse it multiple times? The PHP ...

Determine the time variance in hours and minutes by utilizing the keyup event in either javascript or jquery

There are 6 input fields, with 5 input boxes designated for time and the result expected to display in the 6th input box. See the HTML below: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input ty ...

What steps are needed to transform an HTML string into functional HTML code that will be visible on the front end of a website?

When using a v-for loop to iterate through items, the {{ item.data }} contains HTML elements with defined values. For example: The value of {{ item.data }} is a string "<'qr-code value="this has specific infos that is already created for this spec ...

What is the best method for creating a loop script within a widget using script?

I am trying to implement a loop within a widget, however, the widget contains an internal script: <!DOCTYPE html> <html><head></head><body> <script> list=["AMAR3","BBDC4", "BEEF3", "BPAN4", "BRFS3", "B3SA3", "CVCB3" ...

Unable to retrieve Java variable in JavaScript

Seeking guidance on how to retrieve Json data stored in a Java variable using JavaScript. Instead of accessing the data, the html source is displayed. Java: Gson gson = new Gson(); String json = gson.toJson(obj); request.setAttribute("gsonData", gson) ...

invoking a parent function from a cellRenderer in Vue.js Ag-Grid through emit function

I integrated the ag-grid-vue into my project and added a separate component to one of the columns for user actions, such as Edit, View, or Delete. Editing and deleting records work fine, but when a record is deleted, I want the table to re-render by fetchi ...

Looking for assistance with implementing a jQuery function for an onClick event on

I've been diving into learning jquery and managed to create a basic checkbox feature with a function that allows you to set all options as read-only by checking the "None of the above" button. <html> <body> <form id="diagnos ...