I am trying to use <DIV ...> </DIV> within Javascript, within document.write(), and later load those document objects into an array using eval. Only in NetScape, it does not seem possible. Netscape tells me the object has no properties.<br><br>Here is the code:<br><br>function putInDocumentImages() {<br> var imgFileCnt = 1;<br> var imgFileName;<br> var divStateMent;<br> var divStateMents = "";<br> var imgCnt = 0;<br><br> for (imgCnt = 0; imgCnt < maxImg; imgCnt++) {<br> imgFileName = imgFileBaseName + imgFileCnt + "." + imgFileExtension;<br> imgFileCnt++;<br> if (imgFileCnt > maxImgFile) {<br> imgFileCnt = 1;<br> }<br> divStateMents += "<div id=img" + (imgCnt + 1)<br> + " style='position: absolute; height: "<br> + imgHeight + "; width: " + imgWidth<br> + ";'><img SRC=" + imgFileName + " height=" + imgHeight<br> + " width=" + imgWidth + "></div>\n";<br> }<br> document.write(divStateMents);<br>}<br><br><br>Later on in code I try and load an array with these two functions:<br><br>function loadImageArray() {<br> var i = 0;<br><br> for (i = 0; i < maxImg; i++) {<br> ImageArray<i> = new docObject(i + 1);<br> ImageArray<i>.X = initPosX(i);<br> ImageArray<i>.Y = initPosY();<br> ImageArray<i>.obj.left = ImageArray<i>.X;<br> ImageArray<i>.obj.top = ImageArray<i>.Y;<br> }<br>}<br><br>function docObject(aNumber) {<br> var rand_min;<br> var rand_max;<br><br> this.X = 0;<br> this.Y = 0;<br> this.speedMult = randomSpeed();<br><br> rand_min = FLUTTER_DIR_CHG_MIN - 1;<br> rand_max = FLUTTER_DIR_CHG_MAX - FLUTTER_DIR_CHG_MIN + 1;<br> this.FlutterDirChgRt = Math.abs(random_number(rand_min) + rand_max);<br> this.FlutterDirChgIt = 1;<br> this.FlutterDir = 1;<br><br> if (isNetscape) { <br> this.obj = eval("document.img" + aNumber);<br> } else {<br> this.obj = eval("img" + aNumber + ".style"<br> }<br>}<br><br><br>In the above "loadImageArray()", there will be a problem with the last image loaded. ImageArray<i>.obj.left will have no properties, although it should because of the assignment in function docObject().<br><br>I have ran similar code to this when the "div" statements are in the HTML body, rather than produced by the Javascript. Could this be a problem with document.write not "fully" updating the actual HTML document?<br><br>BTW: For some reason, this post is converting my array element into an italics tag for display. square brackets containing the letter "i" are not displaying in my post.