Jump to content

[SOLVED] I keep getting an undefined error.


ballhogjoni

Recommended Posts

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.