I m trying to update an image in a parent window with clickable links in a child window. I ve preloaded the images in the parent window with one javascript file. "scriptss.js" My problem is I need to access the preloaded images of the parent window with the childscript "scriptremote.js" Thanks again for all the JS Help! The JS (scriptss.js)
var newWindow = null;
window.onload = init;
var i = 0;
image_object = new Image();
myImages = new Array(); // declare array
myImages[0]="images/img1.jpg" // load array
myImages[1]="images/img2.jpg"
myImages[2]="images/img3.jpg"
myImages[3]="images/img4.jpg"
myImages[4]="images/img5.jpg"
myImages[5]="images/img6.jpg"
括号中的超文本:
<img src="" width="200px" height="200px" id="myimage" name="myimage" /></img>
The following s The JS for child即:
window.onload = init;
function init()
{
}
function first_image()
{
window.parent.image_object.src = myImages[3]; //Problem happens here I think
document.getElementById("myimage")window.parent.src = window.parent.image_object.src;
}
无线儿童窗口
<h1>My Remote</h1>
<a href="#" id="first" onclick="first_image()" >First Image</a>
</br>