Dieser Artikel beschreibt die Methode der JavaScript-Popup-Seite, um die Werte zurückzugeben. Teilen Sie es für Ihre Referenz. Die spezifische Implementierungsmethode lautet wie folgt:
A1.html
Kopieren Sie den Code wie folgt: <! DocType html public "-// w3c // dtd html 4.0 transitional // en">
<html>
<kopf>
<title> Fenster 1 </title>
</Head>
<body>
<h1> Fenster 1 </h1>
<Eingabe type = "text" name = "a">
<Eingabe type = "button" onclick = "return test ();" >
<Script>
Funktionstest () {
window.open ('b1.html', 'newwindow', 'height = 100, width = 400');
}
</script>
</Body>
</Html>
B1.html
Kopieren Sie den Code wie folgt: <! DocType html public "-// w3c // dtd html 4.0 transitional // en">
<html>
<kopf>
<title> Neues Dokument </title>
</Head>
<body>
<h1> Fenster 2 </h1>
<Eingabe type = "text" name = "b" value = "11"> <Eingabe type = "subieren" onclick = "return test ();">
<Script>
Funktionstest () {
var bValue = 111;
window.opener.a.value = bValue;
Fenster.CLOSE ();
}
</script>
</Body>
</Html>
Ich hoffe, dieser Artikel wird für JavaScript -Programme aller hilfreich sein.