Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 18
Registered: ‎02-01-2011
My Device: 9550
My Carrier: New Developer
Accepted Solution

how to execute Execute javascript code.

Hello Gurrus,

 

Here is what I am trying to do in my app...

 

I have a text field where user can input any url it wants. Once the url is save, user can click on it and open it in web browser.

 

Now i was looking for advice on how to call a javascript function in blackberry browser or is there any other way??

 

My app has different version based on BB OS, so in short I am building three COD files

 

a) BB OS 4.2

b) BB OS 4.3 to 4.6

c) 4.7 n up...

 

Kindly help me, or guide me in the proper direction..

 

Thanks for the help.

 

Highlighted
Contributor
Posts: 17
Registered: ‎10-22-2010
My Device: Not Specified

Re: how to execute Execute javascript code.

For javascript in browser field you can use 

browserField.displayContent method.

In which you can pass whole script as string .

 

Contributor
Posts: 18
Registered: ‎02-01-2011
My Device: 9550
My Carrier: New Developer

Re: how to execute Execute javascript code.

Well I have been using the method browserField.displayContent method to load the page of the user.

 

Noiw i want to do some scriptiing on this page, so i have enable scriptiing by following code.

 

 

BrowserFieldConfig config = new BrowserFieldConfig();  
config.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
browserField = new BrowserField(config);
But now I want to add the event listener for the user focus and blur of the field.
Kindly help me experts.
Thanks guys for the help and visiting my post.

 

Contributor
Posts: 18
Registered: ‎02-01-2011
My Device: 9550
My Carrier: New Developer

Re: how to execute Execute javascript code.

Guys, gurrus pls help me....

 

I am really stucked up on this....

 

I request BB team to help me with this, or atleast guide me in proper direction.

 

Thanks for the help and visiting the post.

Contributor
Posts: 18
Registered: ‎02-01-2011
My Device: 9550
My Carrier: New Developer

Re: how to execute Execute javascript code.

Dunn worry guys I have figured this out. Ask me if any one of you run into the same problem.

 

I will be glad to help.

 

Thanks again.

New Member
Posts: 2
Registered: ‎03-24-2011
My Device: Blackberry 9700
My Carrier: Simulator

Re: how to execute Execute javascript code.

Hi,

I'm facing the same issue, please help.