mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 10:49:36 +02:00
Update
This commit is contained in:
parent
b5c0398216
commit
30eeac9ab4
1 changed files with 2 additions and 0 deletions
|
@ -4365,10 +4365,12 @@ function callFunctionOrLoadScript(funcName, jsUrl, ...args) {
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.src = jsUrl;
|
script.src = jsUrl;
|
||||||
|
|
||||||
|
console.error(`Function ${funcName} not found loading script ${jsUrl}`);
|
||||||
// Define what happens when the script is loaded
|
// Define what happens when the script is loaded
|
||||||
script.onload = function() {
|
script.onload = function() {
|
||||||
// Check again if the function exists after loading the script
|
// Check again if the function exists after loading the script
|
||||||
if (typeof window[funcName] === 'function') {
|
if (typeof window[funcName] === 'function') {
|
||||||
|
console.error(`Function ${funcName} found after loading script ${jsUrl}`);
|
||||||
window[funcName](...args);
|
window[funcName](...args);
|
||||||
} else {
|
} else {
|
||||||
console.error(`Function ${funcName} does not exist even after loading the script.`);
|
console.error(`Function ${funcName} does not exist even after loading the script.`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue