Este artigo descreve o método de javascipt para passar valores entre dois iframes. Compartilhe -o para sua referência, como segue:
index.htm
<Body> <table> <tr> <td> <iframe src = "iframe1.htm" name = "aa"> </frame> </td> </tr> <tr> <td> <frame src = "iframe2.htm" name = "bb"> </se
iframe1.htm
<html> <title> 1 </title> <head> <script type = "text/javascript"> <!- function aa () {parent.frames ["bb"]. parent.frames ["bb"]. alert (parent.frames ["bb"]. document.all ["textbox3"]. value); alert (parent.frames ["bb"]. document.all ["textbox4"]. valor); } // -> </script> </adhead> <body> <form id = "a"> <input id = "textbox1" type = "text" id = "textbox1" value = "1"/> <input id = "textbox2" type = "text" od = "textbox2" = ""/> <input "3" typen = "" ONCLICK = "AA ();"/> </morm> </body> </html>iframe2.htm
<html> <title> 2 </title> <head> </ad Head> <body> <form id = "b"> <input id = "textbox3" type = "text" id = "textbox1" value = "1231111"/> <input id = "textbox4" type = "text"/"textbox2" ("> <>For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript value transmission operation skills", "Summary of JavaScript encoding operation skills", "Summary of json operation skills in JavaScript", "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation effects and techniques", "Resumo dos erros de JavaScript e técnicas de depuração", "Resumo das estruturas de dados JavaScript e habilidades de algoritmo", "Resumo dos algoritmos e técnicas de travessia de JavaScript" e "Resumo do uso de operações matemáticas de Javascript".
Espero que este artigo seja útil para a programação JavaScript de todos.