<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>无标题页</title>
<!--    <script type="text/javascript" src=JScript5.js></script>-->
<script type="text/jscript">
    function mouseDownHandler(eventObject)
{
   specialKeys="Special keys:";
   if(eventObject.modifiers & Event.ALT_MASK) specialKeys+="ALT";
   if(eventObject.modifiers & Event.CONTROL_MASK) specialKeys+="CONTROL";
   alert(specialKeys);
}
</script>
</head>
<body>
<h1>hahd</h1>
<script>
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=mouseDownHandler;
</script>
</body>
</html>
就这个代码  ! 他说我EVENT没有定义    什么意思?   怎么改一下?

解决方案 »

  1.   


    <script language="JavaScript"> 
    function SearchGoogle(key,evt) 
            { 
                if(evt.keyCode==13 || evt.keyCode==0) 
                { 
                    var keystr = encodeURIComponent(key.value); 
                    url = "http://www.google.com/search?q="; 
                    url = url+keystr; 
                    url += "&ie=UTF-8&oe=GB2312&hl=zh-CN&domains=www.cnblogs.com&sitesearch=www.cnblogs.com"; 
                    window.location=url; 
                    return; 
                } 
            } 
    </script> 
    <H2>Google站内搜索</H2> 
    <h4><input style="WIDTH: 130px" type="text" name="q" onkeydown="SearchGoogle(q,event)">&nbsp;<input onclick="SearchGoogle(q,event)" type="button" value="搜索" name="sa"> 
    </h4> 
    参考
      

  2.   

    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head> 
        <title>无标题页 </title> 
    <!--    <script type="text/javascript" src=JScript5.js> </script>--> 
    <script type="text/jscript"> 
        function mouseDownHandler(eventObject) 

    var e = getEvent();
      specialKeys="Special keys:"; 
      if(eventObject.modifiers & e.ALT_MASK) specialKeys+="ALT"; 
      if(eventObject.modifiers & e.CONTROL_MASK) specialKeys+="CONTROL"; 
      alert(specialKeys); 

    </script> 
    </head> 
    <body> 
    <h1>hahd </h1> 
    <script>
    function getEvent() {
         return window.event || arguments.callee.caller.arguments[0];
        }
        var e = getEvent();
    document.captureEvents(e.MOUSEDOWN); 
    document.onmousedown=mouseDownHandler; 
    </script> 
    </body> 
    </html> 
      

  3.   

    我的EVENT为什么失效?   2楼答案不对