Clarification on Codename One's BrowserComponent execute(String javaScript) method

99封情书 提交于 2019-12-06 22:58:25

BrowserComponent.execute(String) will execute the provide JS snippet in the current page of the browser at the time that you make the call. If your snippet references things that aren't loaded yet, then the javascript will result in an error.

If you want to ensure that the page has finished loading before your snippet is run, then you'll need to provide your own checks. If you execute your js inside the onLoad event of the browser component, then the page will have been loaded. Any <script> tags in the page should also have loaded by that time (as long as they aren't loaded async).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!