getscript 0.1.1 copy "getscript: ^0.1.1" to clipboard
getscript: ^0.1.1 copied to clipboard

Dart 1 only

Dynamic code loading for dart scripts

getScript #

Dynamic code loading for dart scripts, similar to jQuery's getScript(). The loaded modules have full access to the DOM, but no access to the code of other modules.

Usage #

A simple usage example:

import 'package:getscript/getscript.dart';

main() {
  String name = 'one.dart';
  getScript(Uri.parse(name));
}

Returns a Future<ScriptElement> If the script is already loaded, getScript() will not attempt to load it again, so it can be safely used multiple times without triggering superfluous requests.

Features and bugs #

Currently, a Future is returned to indicate that the module has loaded only when running in Javascript. As a workaround during development in Dartium, you can dispatch a custom DOM event from the module and listen for it in the main script.

Please file feature requests and bugs at the issue tracker.

0
likes
10
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

Dynamic code loading for dart scripts

Repository
View/report issues

License

unknown (license)

More

Packages that depend on getscript