1

window.htmlJavascriptで、ポップアップ ウィンドウでファイルを開きたい。しかし、それはテキストを表示しません。ただの白紙。

これは index.html です:

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="style.css" />

  <script language="javascript">
    var newwindow;

    function popit(url){
      newwindow = window.open(
          url, '', "status=yes, height=500; width=500; resizeable=0");
  }
  </script>
</head>
<body>
  <a href="javascript:popit(window.html);">CLICK ME!</a>
</body>
</html>

window.html:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <p>SAMPLE TEXT</p>
</body>
</html>

テキストが表示されないのはなぜですか?

4

3 に答える 3

2
javascript:popit(window.html);

と置換する:

javascript:popit('window.html');
于 2013-04-28T14:42:05.560 に答える