ballhogjoni Posted January 20, 2009 Share Posted January 20, 2009 Firefox is saying aProducts is undefined. Any ideas? var aProducts = new Array(); aProducts = xmlHttp.responseText; eDiv = document.getElementById("products"); eSelect = document.createElement("select"); for(i=0;i<=aProducts.length;i++){ option = document.createElement("option"); option.value = i; option.innerHTML = aProducts[i].name; eSelect.appendChild(option); } eDiv.appendChild(eSelect); Link to comment https://forums.phpfreaks.com/topic/141634-solved-i-keep-getting-an-undefined-error/ Share on other sites More sharing options...
rhodesa Posted January 20, 2009 Share Posted January 20, 2009 where is the code that creates the xmlHttp object? Link to comment https://forums.phpfreaks.com/topic/141634-solved-i-keep-getting-an-undefined-error/#findComment-741419 Share on other sites More sharing options...
ballhogjoni Posted January 21, 2009 Author Share Posted January 21, 2009 I forgot that my db table was empty... so the xmlHttp object was getting an empty array, therefore giving me an undefined array. Link to comment https://forums.phpfreaks.com/topic/141634-solved-i-keep-getting-an-undefined-error/#findComment-741689 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.