Skip to content

Comment on 535 ways to reload the page with JavaScript

Comments

I really see only two ways here:

1) one of hundreds of equivalent syntaxes for the AST that assigns to location, and

2) location.reload()

So if we're going to play this game and these count as different, why not encode the identifiers in hex notation? Or replace the identifiers with lambda calls to compute them? Or eval()?

Seems like if these 535 ways count, so should the other infinity of them.

That's not completely true— location.replace() and location.assign() do slightly different things. But, yeah, this is basically 535 different ways to spell location = location.

And not even very interesting ones. window.window is window, so you can just go nuts with the chaining. So is window.self, window.top, window.frames... window.self.top.frames.location = frames.top.self.window.location? Now we're talkin'.

Yeah, not very exciting. Once you go down that road you pass by window['l' + 'ocation'] on the way to window['loc' + (''+![])[!![]+![]] + (''+!![])[-![]] + 'ion'] and so on. I would have completed it but it's 2:30 and I'm tired.

Aha, indexing the characters out of "false" and "true"... clever.

sorry to bother you sir but could you tell me what that is called and maybe where i find out more about it?

l33t searching skills, I couldn't find it. That's where I learned this technique.

It's called programming. You can learn about it by typing stuff into your computer and seeing what happens.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.