( id: string, async: boolean, src: string, onload: (() => void) | null, text: string )
| 1 | export function scriptLoader( |
| 2 | id: string, |
| 3 | async: boolean, |
| 4 | src: string, |
| 5 | onload: (() => void) | null, |
| 6 | text: string |
| 7 | ): void { |
| 8 | const s = document.createElement('script'); |
| 9 | s.type = 'text/javascript'; |
| 10 | s.id = id; |
| 11 | s.async = async; |
| 12 | s.onload = onload; |
| 13 | s.src = src; |
| 14 | s.text = text; |
| 15 | document.getElementsByTagName('head')[0].appendChild(s); |
| 16 | } |
| 17 | |
| 18 | export function scriptRemover(id: string): void { |
| 19 | const script = document.getElementById(id); |
no outgoing calls
no test coverage detected