UniversalAvenue / TiCrosswalk

WebView replacement for Titanium Mobile
Other
27 stars 12 forks source link

Ensure evalAsync behaves the same across platforms #6

Open jonatansberg opened 9 years ago

jonatansberg commented 9 years ago

Background

The behavior of evalAsync differ between platforms. In order for things to work cross platform you need to wrap your call in an IIFE and make sure to skip the final semicolon.

webView.evalAsync('(function(){ return { some: "object" }; })()', function (res) {
  var obj = res && JSON.parse(res);
});

Todo