Netscape Navigator requires the captureEvents() method to capture events outside of its intended target (in the window, layer, or document object). For example, the following code segment captures all mouseup events in the document: document.captureEvents(Event.MOUSEUP);
document.onmouseup = functionName;
Since Internet Explorer's event model is based on event bubbling, an event is first directed to its intended target (the element that initiated the event). Therefore, the captureEvents() method is not featured in Internet Explorer. It simply isn't required. As a scripter, you must make sure it is not executed under Internet Explorer. 

解决方案 »

  1.   

    Capturing Events
    Internet Explorer 4.0x doesn't provide an explicit function for capturing events at the window or document level. An event is captured by an object when the event reaches it, provided that the object has an event handler that processes the event. If the object doesn't have such an event handler, the event is released.You may recall that Navigator 4.0x features two methods that capture and release events:captureEvents()
    releaseEvents()In Internet Explorer 4.0x you simply need to specify an event processing function to capture an event. The following script segment captures all click events that occur on the document:
    <SCRIPT LANGUAGE="JavaScript">
    <!--document.onclick = functionName;// -->
    </SCRIPT>For example, if you put the following script in your HTML document, an alert dialog box pops up when you click anywhere on the document:
    <SCRIPT LANGUAGE="JavaScript">
    <!--function processClicks() {
      alert("Thank you for clicking the mouse button.");
    }document.onclick = processClicks;// -->
    </SCRIPT>
      

  2.   

    NetScape需要那个方法,IE里不需要:例子:<script>
    if (navigator.appName == "Netscape") {
      document.captureEvents(Event.CLICK);
    }document.onclick = printEvent;function printEvent(e) {
       if (navigator.appName == "Microsoft Internet Explorer"){
        mX = event.clientX;
        mY = event.clientY;
      }
      else {
        mX = e.pageX;
        mY = e.pageY;
      }
      alert("Click at x = " + mX + " and y = " + mY);
    }</script>
      

  3.   


    直接一点
    IE 不支持event