ExternalInterface为我提供了在使用多个参数时停止脚本的选项.为什么?

ExternalInterface gives me an option of stopping the script when using multiple parameters. Why?

本文关键字:参数 脚本 为什么 选项 ExternalInterface      更新时间:2023-09-26

第一个版本:

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

第二个版本:

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

如果我使用第一个版本,它会比第二个慢很多。此外,浏览器会阻塞,几秒钟后,Firefox会向我显示对话框,其中显示"脚本没有响应…",并为我提供了停止它的可能性。如果我使用第二个版本,则会立即调用Javascript。有没有办法让第一个和第二个一样有效?我认为它要干净得多(从代码的角度来看)。

尝试设置一个超时,让ExternalInterface"返回"到Flash,这应该有助于阻止:

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