页面中添加样式: <style media="print"> @page { size: auto; /* auto is the initial value */ margin: 0mm; /* this affects the margin in the printer settings */ } </style> 直接调用 window.print(); 如果ie不支持可以用以下方法:判断出IE浏览器之后调用 if(getExplorer() == &qu
//jsp打印时去除页眉页页脚 打印前加入下面代码即可 var HKEY_Root,HKEY_Path,HKEY_Key; HKEY_Root="HKEY_CURRENT_USER"; HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"; var head,foot,top,bottom,left,right; var Wsh=new ActiveXObject("WScrip
1.获取当前时间: var now=new Date(); //Tue Oct 17 2017 18:08:40 GMT+0800 (中国标准时间) 获取当前时间的日期 new Date().getDate() //17 new Date().toLocaleString() //2017/10/17 下午6:08:40 2.引用moment.js将标准时间转化成YYYY-MM-DD hh:mm:ss var time=moment(new Date()).format("YYYY-MM
代码: # 列出http://www.cnblogs.com/xiandedanteng中所有博文的标题 from bs4 import BeautifulSoup import requests user_agent='Mozilla/4.0 (compatible;MEIE 5.5;windows NT)' headers={'User-Agent':user_agent} for i in range(1,61): html=requests.get('http://www.cnblogs