dart HttpRequest.getString无法使用

时间:2014-07-29 21:00:24

标签: javascript web dart

我正在使用HttpRequest.getString方法动态加载一些内容,这很好用,直到我从dart代码生成一些js。 运行生成的javascript会导致这些错误“访问被拒绝”:

// An uncaught error in the root context terminates all isolates.
    if (identical(this, _globalState.rootContext)) {
      rethrow;
    }

这是飞镖码:

void loadPage(String src)
{
  HttpRequest.getString(src).then((response)
  {
    querySelector("#content").innerHtml=response;
  });
}

问题出在哪里,为什么dart代码有效但不是javascript代码?

1 个答案:

答案 0 :(得分:0)

您可以使用How to change Element innerHtml to Dart SDK 0.7.1中显示的setInnerHtml()来尝试NodeValidator。另请参阅https://groups.google.com/a/dartlang.org/forum/#!topic/misc/kQD2-_hY_DQ