Bonnie_Xie 2013-06-12 09:11 采纳率: 100%
浏览 3370
已采纳

js 按钮不响应怎么解决

 $(function() {      
      $("#back").click(function() {       //返回按钮事件   
       location.href = "welcome.html";
                 });
     $("#search").click(function(){
     var deptno = $("#deptno").val();  
      var res = query("select * from emp where deptno=" + deptno + "");     //组装SQL语句并执行查询
       if(res != null){                //判断是否有返回值
                       //var res_2=query("select * from emp where deptno=" + deptno + ");
     sessionStorage['deptno'] = deptno;       //deptno是要查看员工的部门的编号,把该编号放入sessionStorage,
                        location.href = "get_dep_emp.html";
 }
                 });

             });
         </script>
     </head>
 <body>
         <div class="content">
             <h2 class="title">查询部门员工</h2>
             <hr />
             <table width="90%" align="center" class="tablelist">
                 <tr>
                     <td width="45%" align="right">部门编号:</td>
                     <td><input type="text" id="deptno" /></td>
                 </tr>
                 <td colspan="2" align="center">
                     <input type="submit" value=" 查询 " id="search"  class="button" />
                     <input type="button" value=" 返回 " id="back"  class="button" />
   </td>

             </table>
         </div>
     </body>

但是查询和返回两个按钮都没有响应。。纯属菜鸟,请大神指点

  • 写回答

2条回答 默认 最新

  • hajone 2013-06-13 03:07
    关注

    用chrome的console or Firebug看看有错没有先

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题