Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8787585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:55:40+00:00 2026-06-13T21:55:40+00:00

Well, here I continue, trying to learn this very nice language… So I previously

  • 0

Well, here I continue, trying to learn this very nice language… So I previously had a very ugly code full of ‘document.write()’ and more ugly things, and now I am transforming it into a very nice standards compliant code, and I am liking it! But I found a problem where I don’t see the logic. Here it goes:

In the html file I have this:

<body onload="generatetable(0)">

And in the .js file I have this:

function generatetable(product) {    
    var tbinfo = document.createElement("table");  //table
    var tbbody = document.createElement("tbody");  //tbody
    var row = document.createElement("tr");     // creates row
    for (var i = 0; i < 4; i++) {               // creates 4 cells
        var cell = document.createElement("td");
        }

    var tname = arraypro[product].Name;
    cell.appendChild(tname);

(I don’t paste the rest of the table, because it seems to work fine)

And when running, I get the ‘Exception 8’ error on the var tname = arraypro[product].Name line

But if I do just an

alert(arraypro[0].Name);

it outputs exactly what it should output, the very right word. How it’s possible that the value in arraypro[product].Name can be retrieved by an alert (if you pass the value of ‘product’) but not by the appendChild?

I am still not very well used to the logic of programming, but I try…

PD: The arraypro , where the information is, has been declared as a global value, accessible for everything, in case it matters to know.

Thanks very much for any input here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:55:42+00:00Added an answer on June 13, 2026 at 9:55 pm

    appendChild() expects a DOM-Node, you’re passing in a string I believe.

    You can change it to:

    var tname = arraypro[product].Name;
    cell.appendChild(document.createTextNode(tname));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well i need some help here i don't know how to solve this problem.
Well, Here is the C++ code I've got here and cant compile #include <iostream>
Here is my code (well, some of it). The question I have is, can
Here's the GitHub link: https://github.com/guicocoa/calendar I went through the source code and I'm trying
Well I have been trying this problem for over 10 hours and have no
I'm trying to learn about regular expressions but am not doing so well after
This code was established in a previous post. I'm trying to adapt it to
Well I am trying to run this script in PL/SQL. But I am constantly
I could use a set of eyes (or more) on this code. I'm trying
Extreme Android developer newbie here...well, new to Android development, not development in general. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.