https://github.com/gekorm/getscript
getScript for Dart - dynamic code loading
https://github.com/gekorm/getscript
Last synced: about 1 year ago
JSON representation
getScript for Dart - dynamic code loading
- Host: GitHub
- URL: https://github.com/gekorm/getscript
- Owner: GeKorm
- License: bsd-3-clause
- Created: 2015-06-03T08:36:59.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-04T22:49:39.000Z (over 10 years ago)
- Last Synced: 2025-02-09T05:46:17.124Z (over 1 year ago)
- Language: Dart
- Size: 283 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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`
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][tracker].
[tracker]: https://www.github.com/GeKorm/getScript/issues