首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

iframe和父页面直接如何传值

2012-07-05 
iframe和父页面直接怎么传值?iframe和父页面直接怎么传值?只需要兼容firefox,ie不管[解决办法]父页面。。HTM

iframe和父页面直接怎么传值?
iframe和父页面直接怎么传值?
只需要兼容firefox,ie不管


[解决办法]
父页面。。

HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>    <title></title>    <script>        function send() {            window.frames['child'].document.getElementById('str').value = document.getElementById('str').value;        }    </script></head><body><input type='text' name='str' id='str' /><button onclick='send()' >send the input value</button><iframe name='child' src='child.htm'></iframe></body></html> 

热点排行