世界位置全局位置
location = location
... and 534 other ways to reload the page with JavaScript
location = location
...以及534种其他使用JavaScript重新加载页面的方法
How many ways you can think of when you want to reload the current page with JavaScript? I counted 535 before I got bored, maybe someone can pick up from there? The cases are so much that I had to write a script to generate them 🙂
要使用JavaScript重新加载当前页面时可以想到几种方法? 在无聊之前我数了535,也许有人可以从那里接电话? 案例如此之多,以至于我不得不编写脚本来生成它们them
» have fun, see for yourself
»玩得开心,自己看看
Just occurred to me that I didn't even include the frames
property in those 535 ways. Consider the limitless possibilities having in mind for example that:
我只是想到,我什至没有在这535种方式中包含frames
属性。 例如,请考虑以下无限可能性:
>>> window.frames === window
true
>>> frames === window.self
true
Could you come up with 500 more ways? A 1000? One condition: no recursion, for example window.self.window
is not allowed.
您能再想出500种方法吗? 一千? 一种情况:没有递归,例如,不允许window.self.window
。
Tell your friends about this post on Facebook and Twitter
在Facebook和Twitter上告诉您的朋友有关此帖子的信息
翻译自: https://www.phpied.com/locationlocation/
世界位置全局位置