Edit: My original question was too vague and contained too many sub-questions. I've edited the original out to focus on a more direct question.
I'm loading a list of names into an empty array in my jquery code via AJAX. I can get the first in the list to show up, but nothing after that appears. I ran a test to where only the first two names should appear on my screen, but I'm not getting anything after the first one, and Firefox isn't showing me any errors. I'd really appreciate any help.
.html Code:
<form id="memberNames">
<label>Member #:</label>
<select class="idNum">
</select>
<label>Member Name:</label>
<span class="idName" num="0"></span>
<label>Member #:</label>
<select class="idNum">
</select>
<label>Member Name:</label>
<span class="idName" num="1"></span>
.js Code:
var memList = new Array ();
// This code produces the Member #'s in the select tag
for (var i = 200; i <= 299; i++) {
$(".idNum").append("<option>" + i + "</option>");
}
$.ajax({
mimeType: 'text/plain; charset=x-user-defined',
url:"memName.txt",
type: "GET",
dataType: "text",
success: function (data) {
memList = data.split("\n");
for (var m = 0; m <= memList.length; m++) {
return $('.idName[num="' + m + '"]').html('<input type="text" name="memberName" value=' + memList[m] + '>');
}
}
});
.txt File:
---
John D.
Jane D.
James B.
Mickey M.
etc...