La fenêtre Popup en Javascript

En Javascript, je veux ouvrir mon window.html fichier dans une fenêtre popup. Mais il n'a pas d'afficher n'importe quel texte. Juste une page blanche.

C'est 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>

Pourquoi ne pas afficher n'importe quel texte?

  • Beaucoup de navigateur de bloquer les pop-ups...
InformationsquelleAutor Boy Karton | 2013-04-28