AnsweredAssumed Answered

What is the best way to run javascript after all content is loaded on the page?

Question asked by Josh Blumberg on Jan 20, 2017
Latest reply on Oct 2, 2017 by James Jones

Some content in Canvas is not loaded until after the custom global javascript.  this means you need to wait in some cases until this content loads.

 

At Champlain College we are using an older flavor of Kenneth Larsen JavaScript for accomplishing this.  Unfortunately we are experiencing issues in a number of situations (content-pages works fine, but it is broken in Groups).

 

Here is a link to the code we currently use:

[JavaScript] Old code for loading javascript with Canvas (don't use) - Pastebin.com

 

It looks like some of the recent cases have broken this code, and our javascript is waiting to the fallback time of 3 seconds to load on some pages.

 

I know we need to replace this and are looking for advise on how best to approach this problem.  Developing separate clauses for each type of Canvas page seems tedious and I am unsure what is most likely to remain consistent across Instructure releases.

Outcomes