一周乱弹(1,摸态框增加纵向滚动条2,jQuery 鼠标点击事件3,通过ajax实现批量导出。4,windows查询占用某个端口号程序并杀死其进程)
来源:互联网 发布:死刑知乎 编辑:程序博客网 时间:2024/05/01 08:27
1,摸态框增加纵向滚动条
3,通过ajax实现批量导出。
说明:ajax 其实只是一个javascript中的一个组建 XmlHttpRequest, 他的作用是数据交互, 返回数据是组件内部处理的, 下载是需要浏览器识别http头的,所以如果想实现导出功能,后台要设置response响应头等相关信息
后台代码举例:
在摸态框的body标签上增加:style="height: 600px;overflow: auto"
2 jQuery 鼠标点击事件。
$(function(){ $('a').mousedown(function(e){ alert(e.which) // 1 = 鼠标左键 left; 2 = 鼠标中键; 3 = 鼠标右键 return false;//阻止链接跳转 }) }) 如 $('#downwps2010').mousedown(function(e){ if(3 == e.which){ alert('这 是右键单击事件'); }else if(1 == e.which){ alert('这 是左键单击事件'); } })
js代码:function exportComment(classesId) { //得到班级学生id var url1 = "train/review-stu-find/" + classesId; $.get(url1, function (resp) { var students = resp.data; //ajax动态导出 for(index in students) { var url2 = "train/classes-situation-export/"+classesId+"/"+students[index].id+"?"+Math.random();//这个为我的导出时href的连接, window.open(url2,"_blank"); } }, "json"); }
3,通过ajax实现批量导出。
说明:ajax 其实只是一个javascript中的一个组建 XmlHttpRequest, 他的作用是数据交互, 返回数据是组件内部处理的, 下载是需要浏览器识别http头的,所以如果想实现导出功能,后台要设置response响应头等相关信息
后台代码举例:
/* HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType("application/msword; charset=utf-8"); response.setHeader("Content-Disposition","attachment;filename="+wname); response.setCharacterEncoding("utf-8"); OutputStream outfa = response.getOutputStream();*/ @RequestMapping(value = "/approve-export/{formId}",method = RequestMethod.GET)@ResponseBodypublic void exportApprove(@PathVariable("formId")String formId,HttpServletRequest request,HttpServletResponse response)throws Exception{HWPFDocument hwpf = this.getBaseAllService().getSchoolBusinessApproveService().exportApproveInfo(formId, request);response.addHeader("Content-Disposition", "attachment;filename=" + FileNameEncoderUtil.encode(request,"来校经商申请表.doc"));response.setContentType("application/vnd.ms-excel");OutputStream toClient = new BufferedOutputStream(response.getOutputStream());hwpf.write(toClient);toClient.flush();toClient.close();}其中_blank必须加上,如果写成_self,虽然是循环打开但是后一个会把前一个覆盖,所以最终只会得到一个。
4,windows查询占用某个端口号程序并杀死其进程。
查询占用某个端口号
netstat -aon | findstr "1688"
查看其程序名称
tasklist | findstr "1688"
结束进程
taskkill /pid 1688 /F
0 0
- 一周乱弹(1,摸态框增加纵向滚动条2,jQuery 鼠标点击事件3,通过ajax实现批量导出。4,windows查询占用某个端口号程序并杀死其进程)
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- windows下杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- Windows中杀死占用某个端口的进程
- 一周乱弹(1,eclipse 远程调试tomcat。2,常量类的作用。3,通过花生壳实现远程连接 端口:3389),4oracle查询日期5,bootstrap文本样式6,6 js四舍五入
- DOS查看端口占用情况并杀死占用某个端口的进程
- Windows_杀死占用某个端口的进程
- Windows_杀死占用某个端口的进程
- windows 下查找某个端口号对应的进程并杀死
- C#基础知识(十一)——泛型集合、文件管理、多态、接口
- 解题报告:FZU1692 Key problem 循环矩阵快速幂
- poj 2187 Beauty Contest
- [Leetcode]94. Binary Tree Inorder Traversal
- HTML canvas一些你可能忽视的自带属性
- 一周乱弹(1,摸态框增加纵向滚动条2,jQuery 鼠标点击事件3,通过ajax实现批量导出。4,windows查询占用某个端口号程序并杀死其进程)
- Java异常(一) Java异常简介及其架构
- EZ的间谍网络
- CodeForces-707A. Brain's Photos
- Listener
- Ubuntu 开机自动挂载Windows分区
- 【Linux系统编程】进程同步与互斥:System V 信号量
- 携程工作感言(四)(9.8)
- ros_Install _Kinetic