Rank: Newbie Groups: Member
Joined: 3/18/2018 Posts: 1
|
Using the ObjectForScripting method of providing a javascript interface (which is a FANTASTIC feature. I'm just in trial mode but that may be the clincher), it doesn't seem possible to pass null Strings.
String is a nullable type in .Net, so passing null from javascript makes a lot of sense in some cases (especially since default parameters aren't likely to work). And, of course I'd like the code on our javascript end to be as consistent as possible regardless of which engine we use (WebBrowser2 control supports passing null in ObjectForScripting).
I get: Uncaught Error: Object of type 'EO.WebBrowser.JSNull' cannot be converted to type 'System.String'.
It seems with a little Reflection any it could detect any nullable type and replace JSNull with null for that type (type.Default). Using an object as the parameter, at least I can get the JSNull, but I was hoping to write my interface for ObjectForScripting to be unaware of the specific control (would like to fall back to WebBrowser2 if EO.WebBrowser is not installed or available). Receiving null in one case and JSNull in another is a bit odd. Values seem to work great (although I mostly pass strings) but using null from javascript is a bit odd.
Bug or feature?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Thanks for letting us know. This is an overlook on our end. We will fix this in our next build.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
We have posted a new build that should fix this problem. You can download the new build from our download page. Please take a look and let us know how it goes.
Thanks!
|