For the same piece of code, two calls, one pass, and one exception:
Function clearSelect (obj ){
If (obj & obj. options)
Obj. options. length = 0;
}
The following are some previous experiences:
These are two classic exceptions, which are difficult to locate if you do not know the principles. The following code shows the conditions that occur.
<Iframe src = "javascript: '<script> top. ff1 = {abc: function () {}}< \/script> '"width = 0 height = 0 name =" f1 "> </iframe>
<Button onclick = "f1.location = 'about: blank '; setTimeout ('alert (ff1.abc ()', 0)"> release Code cannot be executed. </button>
<Iframe src = "Javascript: '<script> top. ff2 = {abc: function () {}}< \/script> '"width = 0 height = 0 name =" f2 "> </iframe>
<Button onclick = "f2.location = 'about: blank '; setTimeout ('alert (ff2.toString ()', 0)"> accidentally called method or attribute access </button>
The innerHtml of the p tag cannot insert the center Tag:
<P onclick = "innerHTML = '<CENTER> </CENTER>'"> <button> unknown runtime error </button> </p>
The following is a classic "unable to open the Internet site" exception:
<Div id = "tt"> <div> <script> document. getElementById ("tt"). innerHTML = "" </script> </div>
From these examples, we can see that there is still much room for improvement in IE robustness.