Function loadScript

Loads an external script dynamically.

  • Parameters

    • src: string

      The source URL of the script to load.

    • Optionalasync: boolean = false

      Whether to load the script asynchronously.

    Returns Promise<void>

    • A promise that resolves when the script is loaded successfully, or rejects when an error occurs.