Quote:
Originally Posted by rab1
It looks that you accessing a page that have javascript. You need to enable javascript on the device or in you application.
If you are using a browser field to display your page, enable javascript in your code as follows:
_renderingSession.getRenderingOptions().setPropert y(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true);
The other way, should be from the browser settings on the BB device.
Rab
|
Thanks Rab for your reply, I have changed my code as you suggested. But I get the same error. Can you look my code?
Code:
class ShowFeed {
String s1="<br><br><h3>Current Feeds:</h3><br><br>";
String s2="<a href=http://www.andreasstorm.de/index.php?id=314&type=100>Andreas Storm</a>";
String s3="<INPUT TYPE=BUTTON"+" "+"OnClick"+"="+"return confirm("+"'"+"Are you sure"+"'"+")"+" "+"VALUE=Add_New_Feed>";
String s=s1+s2+s3;
FeedLauncher feedLauncher=new FeedLauncher();
public static void main(String args[])
{
new ShowFeed();
}
ShowFeed() {
feedLauncher.webLauncher(s);
}
}
Code:
class FeedLauncher
{
RenderingSession _renderingSession;
public void webLauncher(String xmlstr)
{
String htmlString=xmlstr;
byte[] temp = new byte[ 1024 ];
temp=htmlString.getBytes();
try{
ByteArrayOutputStream output = new ByteArrayOutputStream();
Base64OutputStream boutput = new Base64OutputStream( output );
output.write( "data:text/html;base64,".getBytes() );
boutput.write(temp);
boutput.flush();
boutput.close();
output.flush();
output.close();
_renderingSession = RenderingSession.getNewInstance();
BrowserSession browserSession = Browser.getDefaultSession();
_renderingSession.getRenderingOptions().setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.JAVASCRIPT_ENABLED, true);
browserSession.displayPage(output.toString());
System.exit(0);
}catch (IOException e)
{
}
}
}