Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart iframe.contentDocument.documentElement.scrollHeight-省道等效项_Dart_Dart Html - Fatal编程技术网

Dart iframe.contentDocument.documentElement.scrollHeight-省道等效项

Dart iframe.contentDocument.documentElement.scrollHeight-省道等效项,dart,dart-html,Dart,Dart Html,final html.iframelement iframe=rootDemoElement.querySelector(“iframe”); 最终int contentHeight=.scrollHeight; 这在JS中起作用: var contentHeight=iframe.contentDocument.documentElement.scrollHeight; 内容文档在Dart中不可用。 是否真的有可能Dart中缺少contentDocument?据我所知,有人试图使浏览器中的

final html.iframelement iframe=rootDemoElement.querySelector(“iframe”);
最终int contentHeight=.scrollHeight;
这在JS中起作用:

var contentHeight=iframe.contentDocument.documentElement.scrollHeight;
内容文档在Dart中不可用。

是否真的有可能Dart中缺少contentDocument?

据我所知,有人试图使浏览器中的Dart比JavaScript更安全,这导致了一种跨窗口通信受到限制的模型(仅限于postMessage)。我假设Iframe也受到同样的限制。有人评论说他们想放弃这一策略,因为这通常是通过使用dart js互操作来实现的

我认为罪魁祸首是您得到了一个
\u DOMWindowCrossFrame
而不是
窗口
实例

可能也有关系

    • 以下是我的解决方案:

      var jsIFrame=新的JsObject.fromBrowserObject(iframe);
      var contentHeight=jsIFrame[“contentDocument”][“documentElement”][“scrollHeight”];
      
      很高兴听到它的帮助。我希望他们最终能解决它。