显示标签为“JS”的博文。显示所有博文
显示标签为“JS”的博文。显示所有博文

2008年11月4日星期二

javascript 打印print 窗口


var invoiceWindow=window.open('','','width=1,height=1,location=NO,locationbar=NO,menubar=YES,screenX=100,screenY=100');
invoiceWindow.document.write("hallo, this is new window");
invoiceWindow.document.close(); // --> Sehr wichtig
invoiceWindow.print();
invoiceWindow.close();

2008年9月22日星期一

Prototype JS Event.observe

CODE:
/*
*you'd want this line of code to run once the form exists in the DOM; but putting *inline scripts in the document is pretty obtrusive, so instead we'll go for a simple *approach that waits till the page is fully loaded:
*/
Event.observe(window, 'load', function() {
Event.observe('percent', 'change', selectProPercent);
}

in main.js:
var selectProPercent = function()
{
......
}