Chapter 7. Dart and JavaScript Interoperation

A lot of web applications are written in JavaScript nowadays and in this chapter, we will focus on how to communicate with them using Dart. We will also cover the following topics:

  • The dart:js library
  • Type conversion
  • JsObject and instantiation
  • JsFunction and the this keyword
  • Dart with jQuery

Interoperation at a glance

Web applications written in Dart can be executed only in a Dart VM that is embedded in a browser called Dartium, a special build of Chromium. To be executed in other web browsers, the Dart code must be compiled to JavaScript—the language supported by all web browsers. Latest tendencies indicate that JavaScript will exist as the language for web development for a long time to come, as it is popular among people and has a lot of tools and frameworks. This means that Dart must have the ability to communicate with the JavaScript code in any web browser.

Note

The JavaScript libraries need to be included in HTML before the Dart code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.240.244