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 9007445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:41:30+00:00 2026-06-16T01:41:30+00:00

First time asking a question here. I have two simple Javascript functions that 1.

  • 0

First time asking a question here.

I have two simple Javascript functions that 1. Generates a random letter, and 2. Populates a 10×10 table with a single letter in each cell. The main function that creates the table is called through a simple HTML button with an onclick and it looks like this:

function BGen()
{
    var board = "<table border='0' width='300' cellpadding='3'>";
    for (h = 1; h <= 10; h++) {
        board = board + "<tr>";
        for (v = 1; v <= 10; v++) {
            board = board + "<td>" + RLGen() + "</td>";
        }
        board = board + "</tr>";
    }
    board = board + "</table>";
    document.write(board);
}

For some reason, when the button is clicked, the table is generated as it should be, but the browser is left sitting on “Connecting…” afterward, as if it’s waiting for something else.

Can anybody possibly shed some light on this? I haven’t a clue why it’s doing so.

Thanks in advance.

  • 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-16T01:41:32+00:00Added an answer on June 16, 2026 at 1:41 am

    You should not use document.write after the page load. That is bad practice.

    You should be using either innerHTML or appendChild to add the new elements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First time asking a question here. I have a question, I have a UIImageView
this is my first time asking a question here. I tried to be well
First time asking a question here. Usually I can find my answer without having
This is my first time asking a question on here. It has been very
It's my first time asking here (I have visited the site several times, but
This is my first time asking a question, please be gentle! I have a
first time asking though i have been visiting for some time. Here's the problem:
this is my first time asking a question here so apologies if I am
it's my first time asking a question here so I'll try to stay on-topic.
First time asking a question here so thanks in advance for your time. 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.