掌握js中停止方法调用的技巧:离异步、中断、回调
js中停止方法的调用的四种操作:异步、离异步、中断异步、回调。比如:网络请求
1、request对象的方法:
3)server.listen(808
0),network()或者server.notify()(这句比较多,不明确)
2、收回方法
1)server.stop()(true,);
2)server.abort()(false,);
3)server.stoptothreshold()(true,);
4)server.stoppropagation()(false,);(在一个特殊场景下)
5)server.stopreject()(false,);
6)server.stoppropagationtothreshold()(false,)。
3、外部阻止
1)server.notify()(false,)
2)server.notifyall()(true,)
3)server.notifyalltothreshold()(false,);
4)server.notifyalltothresholdtohold()(true,);
5)server.notifytothreshold()(false,);
4、内部阻止
1)server.notifyall()(true,);
2)server.notifytothreshold()(false,);
版权申明
本文系作者 @河马 原创发布在河马博客站点。未经许可,禁止转载。
暂无评论数据