I was running through some while loops within my JavaScript code, and became curious as to what caused the loop to remove all the code from the website (except a single header). I figured it was due to the fact that the loop is infinite (since 1 will always equal 1), but was curious as to why it didn't just crash the website. Is it due to the document.write not being specified to a certain path?
javascript: (function() { while (1) { document.write('Y'); }})();
Edit: Thanks for the help, it does seem that document.open was run and caused the page's code to be deleted. The browser then thought this was due to the actual website's code, and Chrome brought forth an error message.