load()

load()

Compatibility:
Prebuilt
Custom

Starts loading the JavaScript bundle needed to eventually join() your first call. Invoking this method is purely an optimization to get a head start on the join() process—by default, the necessary JavaScript will be loaded automatically on the first call to join(), and in many cases it will already be available from cache.

Note that when you invoke load(), you’ll trigger a sequence of events that will keep you informed about the load progress. This is identical to the initial loading sequence triggered by a join():

  • Over the course of a successful load, you’ll get a loading event followed by a loaded event.
  • Over the course of a failed load, you’ll get a loading event followed by a number of load-attempt-failed events (one for each failed automatic attempt), followed finally by an error event.