选择框更改事件中的setTimeout [英] setTimeout in select box change event

查看:41
本文介绍了选择框更改事件中的setTimeout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在选择框上将autopostback设置为true时,为什么onchange事件中需要'setTimeout'?为什么不直接调用__doPostBack?

When I have autopostback set to true on a select box, why is the 'setTimeout' necessary in the onchange event? Why isn't __doPostBack just called directly?

onchange="javascript:setTimeout('__doPostBack(\'ctl00$myselect\',\'\')', 0)" 

推荐答案

来自 JavaScript setTimeout方法与_doPostBack方法一起使用,以确保用户操作在回发发生之前完成.

The JavaScript setTimeout method is used with the _doPostBack method to ensure that the user action completes before the postback occurs.

这篇关于选择框更改事件中的setTimeout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆