Talking with JavaScript

If we take into account the enormous amount of JavaScript code and libraries that exist, and are still being developed, it is very important that we have a simple way to use JavaScript code from within Dart applications, in particular to get access from Dart to the JavaScript code that is running in the same web page. The earliest attempts used window.postMessage, and then a package called js was built. Because of the huge importance of this topic, the Dart team now has provided us with a core library, dart:js, to interoperate with JavaScript. This provides better performance, reduces the size of the compiled JavaScript file, and makes it also easier to use. Once dart:js is ready, the package js has been rewritten to use ...

Get Dart: Scalable Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.