English[???p?n] US[?o?p?n]

adj.open, ??, ??; ?? ??

vt.& vi.(open) ??; n.

??; ??, ??

vi.

??, ??

vt.

??; (??) ??; ????: ?? ????: ?? ????: ??

?????? open() ??? ???

??: ? ??? ?? ?? ??? ??? ????.

??: ??document.open(mimetype,replace)

????: mimetype ?? ??. ?? ?? ??? ??? ?????. ???? "text/html"???. ?? ????. ? ????? ???? ? ??? ?? ??? ?? ??? ???? ???.

??: ? ???? ?? HTML ??? ??? ??? ? ??? write() ??? ?? writeln() ???? ?????.

??: open() ???? ???? ? ??? ?? write() ???? ?? ??? ??? ??? close ???? ???? ??? ?? ?? ??? ??? ???? ??? ?? ???? ???. . ???? ??? ??? ???? ?? ??? ???? ???? ?? ??? ??? ??? ???? ??? ? ???? ??? ? ????.


?????? open() ??? ?

<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript">
function createNewDoc()
  {
  var newDoc=document.open("text/html","replace");
  var txt="<html><body>學習 DOM 非常有趣!</body></html>";
  newDoc.write(txt);
  newDoc.close();
  }
</script>
</head>

<body>
<input type="button" value="打開并寫入一個新文檔" onclick="createNewDoc()">
</body>

</html>

???? ?? ?

??? ????? ??? "???? ??" ??? ?????