5 ms·
How do you solve lv4?
by johnadam 12y ago
How do you solve lv4?
- lazyjones 12y ago' after the timer value, then proceed to construct a JS expression that will be evaluated before the call to setTimer ... Hint: '99'+moo() will evaluate nicely. Don't forgot the "open" the ' again.
- deleted 12y ago[deleted]
- lazyjones 12y agonope, OSX Safari
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- rhubarbcustard 12y agoI can't figure how to close the quote after the '99 ? I realise that specifying ' on URL gets encoded to %27 but not sure how to turn that into the closing ' for startTime('99'); ..... Help!
- aetch 12y agoCan you elaborate on this? I tried that and got "unexpected identifier" as a console error. Not sure how it works.
- tautvidas 12y agoThe point is to break out of the startTimer() function call, e.g.: startTimer('');foo();//'); The remaining '); can be commented out in order to not create any syntax errors.
- lazyjones 12y agoSPOILER ALERT I used this: 1'* alert()* ' (without the spaces needed for markdown here)
- rhubarbcustard 12y agoCould you explain why the * works in there?
- lazyjones 12y agoJS does automatic type conversion in this case, so it's syntactically correct to multiply a string with a number (or function result). We're just interested in the side-effects of alert(), so it doesn't really matter what kind of expression we use it in, as long as it parses correctly and causes alert() to be executed (evaluated).
- mariocarvalho 12y agoNice!
- namanaggarwal 12y agostill not able to get :-(
- codeman123 12y agocan't solve it either :-/
- sourthyme 12y agoUse the text input instead of the url.
- deleted 12y ago[deleted]
- erid 12y agoYou could use %2b instead of + on the URL and it'll work, or just * as mentioned above.
- voxtex 12y ago' + alert() + ' worked for me.
- vsakos 12y agoadd your alert to the img onload
- jofo25 12y agoIn the text input I put: 3') + alert('