So the following code alerts false twice:
window.onload = function(){
alert(window.myframe.myarray instanceof Array);
alert(window.myframe.myarray.constructor === Array);
}
When there's an iframe in the page named "myframe" that has contains an array called "myarray". If the array is moved into the main page (as opposed to the iframe), then the code alerts true twice as expected. Does anyone know why this is?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…