문제

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