The Bubbling Technique & Custom Event in YUI

Good framework for applying MVC design in Web Application.

Javascript that crashes IE

Recently I was helping my colleague to fix a strange bug in his Javascript. The bug behave like this:

  1. Open the web page in IE.
  2. After everything are loaded (HTML, images, scripts, …), click on address bar and press enter
  3. IE crashed 😦

When I try to identify the bug, I’ve created a simple page that can reproduce the bug.


<div id="panel"></div>
<a href="#" onclick="loadScript(); return false;">Load script</a>

    var n = 0;
    var callback = function() {
        var panel = document.getElementById("panel");
        panel.innerHTML = "loadScript called " + n + " times.";
        var node = document.getElementById("testid");

    var loadScript = function() {
        var node = document.createElement("script");
        node.src="crash.js"; = "testid";


    window.onload = loadScript;

Continue reading