OCX事件动态注册

代码:
<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> <% @ page language = " java "  contentType = " text/html; charset=UTF-8 "  pageEncoding = " UTF-8 " %>
<! DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" >
< html >
< head >
    
< meta  http-equiv ="Content-Type"  content ="text/html; charset=UTF-8" >
    
< title > 呼叫中心座席服务系统 </ title >
    
< script  type ="text/javascript" >     
    
/* *
     * 初始化OCX空间,注册相应的事件
     
*/
    
function  initActiveX() {
        agentClient 
=  document.getElementById( " agentClient " );
        agentClient.Create(AGENT_SERVER, AGENT_PORT);
        
//  电来事件
        agentClient.attachEvent( " AgentRing " , onAgentRing);
        
//  坐席状态变化事件
        agentClient.attachEvent( " AgentStateEvent " , onAgentStateEvent);
        
//  动作变化
        agentClient.attachEvent( " AgentActionLog " , onAgentActionChange);
        
//  实时取得操作信息事件
        agentClient.attachEvent( " AgentActionEvent " , onAgentActionEvent);
        
// 注册 获取坐席信息列表、外线排队列表及外线排队人数通知事件
        agentClient.attachEvent( " AgentGetInfoEvent " ,onAgentGetInfoEvent);
        
// 注册 电来振铃应答结果事件
        agentClient.attachEvent( " AgentRingResult " ,onAgentRingResult);
    }
    
</ script >
</ head >

< body >
    
< OBJECT  ID ="agentClient"  CLASSID ="CLSID:09376935-62B7-4BFD-9C6D-88689E247D0C"  style ="width: 0;height: 0"   ></ OBJECT >
</ body >
</ html >
< script  type ="text/javascript" > initActiveX() </ script >


你可能感兴趣的:(JavaScript,html)