Dart:如何以编程方式将标题添加到弹出式'窗口?

时间:2015-07-22 19:57:09

标签: dart dart-html

我设法显示以编程方式创建的'弹出'当点击/点击我的主页上的按钮但不知道如何显示标题时,带有一些按钮的页面。我该怎么做,还有其他任何我应该在HEAD中设置的项目吗?我是这里的新手。

btnToolsClicked(Event e) { 

  var content = 'Choose an Action <b>(Work In Progress)</b>'
    '<div id="menu-btns" class="radio-btns">'
      '<input id="B1" type="radio" name="radio-btn">'
        '<label id="lblB1" class="radiobutton-label" for="B1">&nbspExtract Thermal Data.</label><br>'
      '<input id="B2" type="radio" name="radio-btn" >'
        '<label id="lblB2" class="radiobutton-label" for="B2">&nbspCopy Data to USB drive.</label><br>'
      '<input id="BClose" type="radio" name="radio-btn" >'
        '<label id="lblClose" class="radiobutton-label" for="&nbspBClose">Close</label>'
    '</div>';


  JsObject w =
  context.callMethod("open",["","MsgWindow","width=640,height=480,top=100,left=100"]);

  JsObject doc = w['document'];
  doc['head']['innerHtML'] = '<title>Tools Menu</title>'; // FAILS
  doc['body']['innerHTML'] = content;
}

1 个答案:

答案 0 :(得分:2)

没有测试过,但我希望这可行:

  JsObject doc = w['document'];
  doc['title'] = 'Tools Menu';