質問

I had deployed my blackberry app which loads html pages from resource files. The html files have javascript and jquery and i need to enable javascript as in Android.

BrowserField browser = new BrowserField();

add(browser);

InputStream content = getClass().getResourceAsStream("/resourcesWeb/index.html");     
try {
   byte[] html = IOUtilities.streamToBytes(content);
   browser.displayContent(new String(html), "http://localhost");
} catch (IOException e) {
   e.printStackTrace();
}
役に立ちましたか?

解決

It should be enabled by default, but here's how you'd force it:

    BrowserFieldConfig config = new BrowserFieldConfig();
    config.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
    BrowserField browser  = new BrowserField(config);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top