javascript - dart2js's output causes "null is not an object" -
after running
private/dart/dart-sdk/bin/dart2js -m -o public/js/script.js private/dart/script.dart   the resulting javascript returns
typeerror: 'null' not object (evaluating 'j.re(a).gvs')   however, error while not minified is
typeerror: 'null' not object (evaluating 'j.getinterceptor$x(receiver).get$onblur')   which might more meaningfull.
it whether use script.js, or script.compiled.js.
the dart code is
import 'dart:html'; import 'dart:core';  void main() {    queryselector("#authorinput").onblur.listen(updatesurname); } void updatesurname(event e){    string author = (e.target inputelement).value;    string surname = author.split(' ').last;    queryselector("#surnameinput").text = surname; }   the relevant haml is
  .form-group      %label(for="authorinput") author      %input.form-control#authorinput(type="text" name="author" placeholder="enter author")   .form-group      %label(for="surnameinput") surname      %input.form-control#surnameinput(type="text" name="surname" placeholder="enter surname")   i believe should work is, though that's not case.
figured out.
i included compiled javascript file inside tag of html page. moving bottom of body fixed everything.
Comments
Post a Comment