The news of a single line of javascript code crashing internet explorer intermittently was like Yanni to my ears. This is very true, Stuart Brown has come up with a piece of code which is exactly 61 bytes long and it crashes IE but not Firefox. The piece of code throws an exception in IE and quits. This piece of code can be incorporated on any webpage. So, wemasters who support Firefox, let’s start adding this code to all the websites we design.
Stuart Brown accidentally stumbled upon this piece of code which he wrote one year back. He wrote a script to iterate through objects and print their properties. He tried this on the ‘document.write’ method, used to output text to the document. He forgets the reason, but remembers the outcome.
Here is the code :
<script>for (x in document.write) { document.write(x);}</script>
Be warned, if you are running Internet Explorer, your browser will most likely crash, taking all your currently open windows with it, and possibly rendering your system unstable.
For those of you running IE still, it’s time to switch to stop all these glitches hampering your browsing experience. Better late than never.




































































November 26th, 2006 at 1:44 pm
for (x in document.write) { document.write(x);}