Este artículo describe el método de Javascipt para aprobar valores entre dos iframes. Compártelo para su referencia, como sigue:
index.htm
<Body> <Table> <tr> <TD> <iframe src = "iframe1.htm" name = "aa"> </frame> </td> </tr> <tr> <tr> <td> <iframe src = "iframe2.htm" name = "bb"> </iFrame> </td> </tr> </table> </body>
iframe1.htm
<html> <title> 1 </title> <head> <script type = "text/javaScript"> <!- function aa () {parent.frames ["bb"]. document.all ["textbox3"]. valor = document.getElementById ("textbox1"). valor; parent.frames ["bb"]. document.all ["textbox4"]. valor = document.getElementById ("textbox2"). Value; alert (parent.frames ["bb"]. document.all ["textbox3"]. valor); alert (parent.frames ["bb"]. document.all ["textbox4"]. valor); } // -> </script> </head> <body> <form de formato = "a"> <input id = "textbox1" type = "text" id = "textbox1" value = "1"/> <input id = "textbox2" type = "text" id = "textbox2" value = "2"/> <input id = "t" type = "booth" value = "3333333" oncLick "a a a a aar ("; ") </form> </body> </html>iframe2.htm
<html> <title> 2 </title> <fead> </head> <body> <form de formato = "b"> <input id = "textbox3" type = "text" id = "textbox1" valor = "1231111"/> <input ID = "textbox4" type = "text" id = "textbox2" value = "123"/> </form> </body> </html>
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", "Resumen de los errores de JavaScript y las técnicas de depuración", "Resumen de las estructuras de datos de JavaScript y las habilidades de algoritmo", "Resumen de algoritmos y técnicas de traversal JavaScript" y "Resumen del uso de operaciones matemáticas de JavaScript"
Espero que este artículo sea útil para la programación de JavaScript de todos.