JavaScript打印函数myPrint(obj): JavaScript打印页面指定div区域原理:使用window.open()在浏览器打开一个新的页面(window), 使用 window.document.write()将指定div区域的内容写入新窗口文档,document.close()关闭文档,使用window.print()调用打印机打印当前文档. function myPrint(obj){ //打开一个新窗口newWindow var newWindow=window.ope
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta h
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Page</title> <script language="javascript" type="text/javascript"> function printDiv(divID) { //Get the HTML of div var divEleme
//js对象打印函数 function writeObj(obj) { var description = ""; for (var i in obj) { var property = obj[i]; description += i + " = " + property + "\n"; } alert(description); }