BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-16-2008, 10:18 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: do not know
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Error: Java Script is not enabled

Please Login to Remove!

Hi every body,

I am getting the following message when I click on the button of my application.

"The request action could not be performed. Java Script is not enabled on this handheld"

Thanks in advance
Offline  
Old 05-18-2008, 07:57 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Offline  
Old 05-19-2008, 03:18 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: do not know
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by rab1 View Post
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)
        {
        }        
    }
}
Offline  
Old 05-19-2008, 09:41 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 25
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your code looks fine. But I think that the displayPage() uses an instance of the BB web browser. The solution I mentioned applies to when you are using a browser field. That could be the reason.
In this case you need to try the second alternative I mentioned.
Click on the Browser icon in the home screen, to open the Blackberry browser, click on menu, select "Oprions" then "Browser Configuration" , then check the option "Support Javascript". then "save options" from the pop-up menu. This will hopefully enable it.

Rab
Offline  
Old 05-19-2008, 10:32 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: do not know
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Rab
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.