0

In the book Javascript for hackers, Gareth Heyes overwrites the window.onerror method with eval, used to execute a function. From my understanding, the following snippet run in a browser console should pop up an alert with the number 1337. However it doesn't work and none of the examples in that section work for me.

onerror=eval;
throw"=alert\x281\x29";

can someone explain why it's not working and how to make it work? For full context refers to the preview of the book, section "Calling functions with arguments without parentheses", page 11, 12. https://www.google.fr/books/edition/JavaScript_for_hackers/FVWjEAAAQBAJ?hl=en&gbpv=0

0

You must log in to answer this question.

Browse other questions tagged .