Window createPopup()Methode
Window-Objekt
Definition und Verwendung
Die Methode createPopup() wird verwendet, um ein Popup-Fenster zu erstellen.
Syntax
window.createPopup()
Browser-Unterstützung
![]()
![]()
![]()
![]()
![]()
Hinweis:Nur Internet Explorer unterstützt die createPopup()-Methode; andere Browser unterstützen sie nicht.
Beispiel
Beispiel
Popup-Fenster erstellen:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
<script>
function show_popup(){
var p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="lime";
pbody.style.border="solid black 1px";
pbody.innerHTML="This is a popup! Click outside the popup to close.";
p.show(150,150,200,50,document.body);
}
</script>
</head>
<body>
<button onclick="show_popup()">Popup anzeigen!</button>
<p><b>Hinweis:</b> Die Methode createPopup() funktioniert nur im IE!</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
<script>
function show_popup(){
var p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="lime";
pbody.style.border="solid black 1px";
pbody.innerHTML="This is a popup! Click outside the popup to close.";
p.show(150,150,200,50,document.body);
}
</script>
</head>
<body>
<button onclick="show_popup()">Popup anzeigen!</button>
<p><b>Hinweis:</b> Die Methode createPopup() funktioniert nur im IE!</p>
</body>
</html>
Selbst ausprobieren »
Window-Objekt Andere Erweiterungen