onbeforeunload是个指针,你当然不能使用bunload(1,2)了
try
window.onbeforeunload=function() {bunload(1,2);}
or
window.onbeforeunload=new Function("bunload(1,2);");