本文介绍了ExternalInterface的给我使用多个参数时停止脚本的选项。为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一个版本:

ExternalInterface.call("$(document).trigger", "opened_file_chooser");

第二个版本:

Second version:

ExternalInterface.call("$(document).trigger('opened_file_chooser')");

如果我用的第一个版本,它的多,比第二慢得多。此外,浏览器模块,并在几秒钟后,火狐显示我的对话的脚本没有响应......并提供我停止它的可能性。如果我用的是第二版,调用Javascript是瞬间完成的。有没有一种方法,我可以做第一个工作以及第二?我认为这是更清洁(从一个code点)。

If I use the first version, it's much, much slower than the second. Also, the browser blocks, and after a few seconds Firefox shows me the dialog with "A script is not responding ... " and it offers me the possibility of stopping it. If I use the 2nd version, the call to Javascript is instantaneous. Is there a way I could make the first one work as well as the second? I think it's much cleaner ( from a code point of view ).

推荐答案

尝试设置超时,这将让ExternalInterface的回归到Flash这应有助于与阻塞:

Try setting a timeout which will let ExternalInterface "return" to Flash which should help with the blocking:

ExternalInterface.call("setTimeout","$(document).trigger('opened_file_chooser')","100");

这篇关于ExternalInterface的给我使用多个参数时停止脚本的选项。为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 22:36