The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Issue with .innerHTML, When tested on Scrimba, it says error in setting attributes to null bu
dkar_0029
post Nov 17 2021, 01:40 PM
Post #1





Group: Members
Posts: 5
Joined: 17-November 21
Member No.: 28,175



I want to replace the "No students enrolled" with the output from displayStudents(testArray) when it runs. I have attached the .js and .html files for reference.
Thanks!


Attached File(s)
Attached File  assignment_1a.zip ( 1.48k ) Number of downloads: 206
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Nov 17 2021, 03:51 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



Could it be due to

CODE
studentEnrolSummaryRef.innerHTML = displayStudents(studentList);

that uses the empty studentList array?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dkar_0029
post Nov 17 2021, 04:06 PM
Post #3





Group: Members
Posts: 5
Joined: 17-November 21
Member No.: 28,175



QUOTE(Christian J @ Nov 17 2021, 03:51 PM) *

Could it be due to

CODE
studentEnrolSummaryRef.innerHTML = displayStudents(studentList);

that uses the empty studentList array?

Nope, I have been testing a simplified version that doesn't work either


Attached File(s)
Attached File  Simplified.zip ( 1.18k ) Number of downloads: 189
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
dkar_0029
post Nov 18 2021, 12:28 AM
Post #4





Group: Members
Posts: 5
Joined: 17-November 21
Member No.: 28,175



QUOTE(dkar_0029 @ Nov 17 2021, 04:06 PM) *

QUOTE(Christian J @ Nov 17 2021, 03:51 PM) *

Could it be due to

CODE
studentEnrolSummaryRef.innerHTML = displayStudents(studentList);

that uses the empty studentList array?

Nope, I have been testing a simplified version that doesn't work either


UPDATE - I FOUND IT!


Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 18 2021, 10:44 AM
Post #5


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



QUOTE(dkar_0029 @ Nov 18 2021, 06:28 AM) *

UPDATE - I FOUND IT!

That doesn't explain the javascript errors though, a broken path to the JS file would prevent the script from running at all. I wouldn't worry about Scrimba though, use your web browsers' developer tools instead (both Firefox and Chromium-based).

And like Brian said, methodical debugging is the key...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 02:03 PM