You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, when we go to this page jsGuide, at first we see all the page contents at first and after a delay, we see the table of contents on the top of the page.
The text was updated successfully, but these errors were encountered:
ellietms
changed the title
Seeing the Table of Contents section after rendering content of the jsguide page.
Seeing the Table of Contents section with delay.
Nov 29, 2021
The reason for this seems to be due to using the onload event: the jsguide.html has a <body onload="initStyleGuide();">, and function initStyleGuide (found in include/styleguide.js) contains a call to CreateTOC which dynamically builds the table of contents. Using onload causes the javascript to execute after the page has been fully loaded, as far as I can tell.
If someone wanted to find a way to avoid this, they'd have to somehow ensure the CreateTOC logic still works before the whole page is fully loaded; unfortunately, that code relies on (at least most of) the page being loaded to work, since it reads the DOM and creates the table of contents dynamically based on it.
Hi, when we go to this page jsGuide, at first we see all the page contents at first and after a delay, we see the table of contents on the top of the page.
The text was updated successfully, but these errors were encountered: