使用jquery:
1.jsp<body>
    <%--  <jsp:include page="2.jsp" /> --%>
    <script type="text/javascript">
     var index = 0;
     function addTab(){
  index++;
  $('#viewdata').tabs('add',{
  title:'New Tab ' + index,
      iconCls:'icon-save',
  closable:true,
  href:"2.jsp"
  });
  }    $(function(){
         $("#ok").bind("click", function(){        
          addTab();          
         });
        });   
  </script>
</body>
   .......
 </html>
2.jsp
<head>
   <script type="text/javascript">
   
   function hello(){
   alert('a');
       $("#cancel").bind("click", function(){
        alert('bbb');
      
       });    
   }
     
    $(function(){
     hello();      
    });    
   
  </script>
</head>
<body>
    <div>
       <a href="#" id="cancel" class="easyui-linkbutton" iconCls="icon-ok">ok</a>
    </div>    
</body>
</html>
发现2.jsp中事件不响应,请问为什么????