JavaScript 恶作剧/笑话
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26965331/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JavaScript Prank / Joke
提问by Luc
How do you prank a coworker or friend in a way that's hard to notice and fix? Preferably in JavaScript, and without having install any programs.
你如何以一种难以注意到和修复的方式恶作剧同事或朋友?最好使用 JavaScript,无需安装任何程序。
回答by Luc
Greek Question Mark - Semicolon Prank
希腊问号 - 分号恶作剧
(Tested in JavaScript)
(在 JavaScript 中测试)
Replace one or several semicolons in a coworker or friend's code with the Greek question mark:
用希腊问号替换同事或朋友代码中的一个或多个分号:
?
?
(source: http://en.wikipedia.org/wiki/Question_mark#Greek_question_mark)
(来源:http: //en.wikipedia.org/wiki/Question_mark#Greek_question_mark)
If you compare the two they look exactly the same: ?;
如果将两者进行比较,它们看起来完全相同: ?;
The first
?is a greek question mark, and the second;is a normal semicolon.
第一个
?是希腊问号,第二个;是正常的分号。
The greek question mark throws a SyntaxError: Unexpected token ILLEGALin JavaScript, and probably throws errors in other languages as well. Make sure you're saving the code file in Unicode/UTF-8.
希腊问号SyntaxError: Unexpected token ILLEGAL在 JavaScript 中抛出 a ,在其他语言中也可能抛出错误。确保以 Unicode/UTF-8 格式保存代码文件。
Disclaimer: I take no responsibility for any harm caused by this prank. Have fun!
免责声明:对于此恶作剧造成的任何伤害,我概不负责。玩得开心!

