Forum Moderators: open
Error: document.getElementById("image_0_0") has no properties
Here's my code:
function widthifyImages() {
SetImageMargin("image_0_0", 0, 0);
}
function SetImageMargin(picName, picNumberA, picNumberB){
var myObject=new Object();
GetRowWidth(picName, picNumberA, picNumberB, myObject);}
function GetRowWidth(picName, picNumberA, picNumberB, myObject) {
var all_image_widths = new Array();
pic = document.getElementById(picName);
all_image_widths[0] = new Array();
all_image_widths[0][0] = document.getElementById("image_0_0").width;
}
document.onLoad = widthifyImages();
And later in the body of the HTML...:
<img src="1013_1.jpg" alt="Canyon Princess" title="Canyon Princess" name="image_0_0" id="image_0_0" class="artist_img_thumbnail" />
This JS was cut to only the relevant part that has to do with the first image. It seems utterly convinced, no matter how I do it, that the image "image_0_0" has no properties. And yet image_0_0 is right there plain as day! Any thoughts?
[edited by: LockeZ at 5:36 pm (utc) on Aug. 2, 2007]