-
1
- #1
Anml4ixoye
Programmer
Hello!
I am using the following code to cycle through the objects in an array I have established:
When I call the function from the code, it writes all of the objects but then includes an undefined at the bottom of the list. In a further test, I added an alert to the end of the function after document.write(names). The alert pops up after the last object is written, but before the undefined. Once you click on Ok, the undefined is written to the page.
Anyone have any thoughts? I'm probably overlooking something simple, but we can't seem to get it. Thanks!
Cory
I am using the following code to cycle through the objects in an array I have established:
Code:
function listGlosNames(obj) {
var names = "";
for(var i in obj) names += "<a href='test.htm?key=" + i + "'>" + i + "</a><br>";
document.write(names);
}
When I call the function from the code, it writes all of the objects but then includes an undefined at the bottom of the list. In a further test, I added an alert to the end of the function after document.write(names). The alert pops up after the last object is written, but before the undefined. Once you click on Ok, the undefined is written to the page.
Anyone have any thoughts? I'm probably overlooking something simple, but we can't seem to get it. Thanks!
Cory