/根据id 选择特定区域function SelectRange(id) { var div = document.getElementById(id); var controlRange; if (document.body.createControlRange) { controlRange = document.body.createControlRange(); controlRange.addElement(div); controlRange.execCommand('SelectA…
File读取和FileReader() //获取上传的文件/图片 function getFile(){ var files,len; var reader = new FileReader(); var img_type; addEvent(selectFile,'change',function(){ files = this.files;//selectFile为上传文件表单,this.files获取选择的文件 len = files.length; if(len > 0){ img_ty…
<script> function myPrint(obj){ var newWindow=window.open("打印窗口","_blank");//打印窗口要换成页面的url var docStr = obj.innerHTML; newWindow.document.write(docStr); newWindow.document.close(); newWindow.print(); newWindow.close(); } </scr…