Replies: 1 comment
-
I'm also getting this error. Here's a simplified example: function foobar(x) {
// Non-relevant multi-line function here
}
Array.from(document.querySelectorAll("…")).map(el => el.remove()); I get an function foobar(x) {
// Non-relevant multi-line function here
};
// ↖ Notice the added semicolon
Array.from(document.querySelectorAll("…")).map(el => el.remove()); Then I get If I copy-and-paste the entire code into the browser dev tools, it works flawlessly; so I know my code is valid. I even tried copy-pasting into a string and then After a long troubleshooting time, I think changedetection is having trouble with the function statement. If I replace it with a function expression and assign it to a variable, it seems to work: var foobar = (function(x) {
// Non-relevant multi-line function here
});
Array.from(document.querySelectorAll("…")).map(el => el.remove()); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello and thank you for the wonderful program
I am trying to run a function within the program but it does not work
in Execute JavaScript before change detection
I am not a professional just a student
Note: This is a sample example of the function I want to run, but even this example does not work
Error:
Page request from server didnt respond correctly - SyntaxError: Unexpected identifier 'setTimeout' at eval () at UtilityScript.evaluate (:226:30) at UtilityScript. (:1:44)
Beta Was this translation helpful? Give feedback.
All reactions