When you create a new “web application” using the Dart editor, it creates a .html file and a .dart file. The html file uses a tag to link to the .dart file, for example:
MyApp.html //contains <script type="application/dart" src="MyApp.dart"></script> MyApp.dart //contains dart app code.
The editor can also generate a javascript file from a .dart file, for example:
MyApp.dart.js
As for the web server, these are just static files that are transferred to the browser.
The html file contains a link to a special JavaScript script that can identify if the browser used has built-in Dart support (i.e. Dartium).
If so, then a couple of MyApp.html and MyApp.dart files are used.
If the browser does not support Dart initially, a special script dynamically changes the script element to point to the MyApp.dart.js file instead, so that the browser receives a javascript version of your application.
This means that you can copy three files (.html, .dart, .js) to any web server (localhost or otherwise) and just go to the .html file.
For completeness, the “special script” can be viewed here: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js
Chris buckett
source share