function
test()
{
__doPostBack('Button1','');
}
{
__doPostBack('Button1','');
}
<
body
MS_POSITIONING
="GridLayout"
onbeforeunload
=" test()"
>
但是如果在别的地方调用__doPostBack就没有问题
我再在__doPostBack后面加了一个延时,就可以了
<
script
>
function pause(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while ( true ) {
now = new Date();
if (now.getTime() > exitTime)
return ;
}
}
function test()
{
__doPostBack('Button1','');
pause( 100 );
}
</ script >
function pause(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while ( true ) {
now = new Date();
if (now.getTime() > exitTime)
return ;
}
}
function test()
{
__doPostBack('Button1','');
pause( 100 );
}
</ script >
但感觉处理地不专业,
感觉像__doPostBack用一个线程,onbeforeunload用另外一个线程。如果让__doPostBack先完成并使onbeforeunload挂起一些时间,就OK了...不知理解对不对