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

Web and WebWorks Development

Reply
New Developer
vannux
Posts: 4
Registered: ‎11-18-2008
My Device: Not Specified

javascript document.cookie problem

Hi all,

I'm trying to use the BrowserField2 and cookies, in a web page using:

 

<body><SCRIPT language="javascript">

 alert("set cookie!");
 document.cookie = "testCookie=s; expires=Thu, 01-Jan-12 00:00:01 GMT";

 alert("ok");

</SCRIPT>

 

the 2nd alert is never shown.

I've tried also with try/catch but the javascript execution is always blocked in the line

document.cookie = ...

but the html is rendered correctly

In the app i'm using the config:

_bfConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
 _bfConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_POINTER);
 _bfConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
 _bfConfig.setProperty(BrowserFieldConfig.ENABLE_COOKIES, Boolean.TRUE);
 _bfConfig.setProperty(BrowserFieldConfig.COOKIE_MANAGER, _cookieManager);

 _bfConfig.setProperty(BrowserFieldConfig.CONTROLLER, _protocolController);

 

tested in

simulator BB 8900 OS 5.0.0.411

device BB8900 OS 5.0.0.411

 

Is it possible to use document.cookie = ... ?

How?

 

tnk,

Mauro

Please use plain text.