时间:2021-07-01 10:21:17 帮助过:70人阅读
temp数组 是变量吗? 通过 1.html 来控制里面的内容? 并传给 2.html?
1.html
<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><p id="demo"><img src="http://c.csdn.net/bbs/t/5/i/pic_logo.gif" /><img src="http://images.csdn.net/20120528/程序员6月封面_副本_副本.jpg" /></p><button onclick="window.open('2.html');">OPEN</button><script type="text/javascript">var obj = document.getElementById('demo').getElementsByTagName('img'), ar = [];for (var i = 0; i < obj.length; i ++) ar.push(obj[i]);</script></body></html>
2.html
<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><script type="text/javascript">var ar = window.opener.ar;alert(ar[0].src);</script></body></html>
var ar = window.opener.ar
求解释