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

  • Home
  • SEARCH
  • 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 6828223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:21:28+00:00 2026-05-26T22:21:28+00:00

Im having an issue using Java script to create a table that displays an

  • 0

Im having an issue using Java script to create a table that displays an array. I must use an external Javascript file to create the array, and use a for loop to create and populate a table. The issue I am having is nothing is happening inside of the script tags. I can write “Document.write(‘Hellow World!’)” and nothing happens. So not surprise when i try to create the for loop with the array, nothing happens. Any help would be appreciated. This is my first time using Javascript in this manner and the notes that professor provided hold no relevant information on how to go about creating a tab;e using a for-loop.

myarray.js

var classArray = new Array();
classArray[0] = "CST415 Software Enterprise II";
classArray[1] = "CST420 Foundations for Distruibuted Web Applications in Java"
classArray[2] = "CST433 Database Technology"
classArray[3] = "Ethics and Professional Computing"
classArray[4] = "Introdiction to Graphics Programming"

Suspect Code:

<table class="classes">
    <tr>
        <td>
            Classes Taken for Computer Science Major
        </td>
    </tr>
        <script type="text/javascript" src="myarray.js" >
            for(var i=0; i<5;i++){
                document.write('<tr><td>');
                document.write(classArray[i]);
                document.write('</td></tr>');

            }
        </script>
</table>
  • 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-05-26T22:21:29+00:00Added an answer on May 26, 2026 at 10:21 pm

    You can’t have a single <script> both load an external .js file (via the src= attribute) AND contain its own in-line code (your for loop). You must split this into two parts:

    <script type="text/javascript" src="myarray.js"></script>
    <script type="text/javascript">
       for (...) {
          ....
       }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having issues with loading external javascript using JQuery. Every time when I
I am having trouble resolving an issue using traditional JavaScript and was wondering if
I'm having an issue with building a Javascript object, and calling methods within that
I'm having an issue creating a link like <a href=javascript:window.open('www.microsoft.com');>Visit Microsoft</a> using stringbuilder. I
I am using jQuery UI tabs, but I am having an issue. My javascript
I am having a issue using Google's SDC (Secure Data Connector) with my Google
I'm having an issue using the Cookie class of the Servlet API 2.5 on
I believe I am having a memory issue using numpy arrays. The following code
i'm having a little issue with doctrine using symfony 1.4 (I think it's using
I'm having an issue verifying if a checkbox is checked using jquery on Internet

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.