GS is correct.
To be more specific:
function handleHttpResponse(pObjRequest, pElementId) {
if (pObjRequest.readyState==4) {
if (pObjRequest.status==200) {
document.getElementById(pElementId).innerHTML=pObjRequest.responseText;
pObjRequest=null;
}
}
}
pObjRequest.responseText contains your zip codes from your CSV file.
You will have one large string with the file contents so you'll need to parse it, preferably into an array.
Without the file structure I can't give you a concrete example, but assuming this:
"99925","55.552611","-133.0555"CRLF
"99925","55.552611","-133.0555"CRLF
"99926","55.121491","-131.579"CRLF
"99926","55.121491","-131.579"CRLF
"99927","56.307858","-133.37637"CRLF
"99927","56.307858","-133.37637"CRLF
"99929","56.433524","-132.35292"CRLF
"99929","56.433524","-132.35292"CRLF
"99950","55.942471","-133.18479"CRLF
"99950","55.942471","-133.18479"CRLF
Then you can do this to put the values into an array:
...
<script type="text/javascript">
<!--
// might be just String.fromCharCode(10) for some file systems
var eol = String.fromCharCode(13,10);
// might be empty or a single quote on some files, change delimeter and delimRegEx as per the file
var delimeter = '"';
var delimRegEx = new RegExp("\"","\g"); // global replace, e.g. all in the string
var crRegEx = new RegExp("\r","\g"); // global replace, e.g. all in the string
var zipArray = new Array();
// even if the file does not have a CR, we can still get rid of any.
var tmpStr = pObjRequest.responseText.replace(crRegEx,'');
var tmpLines = tmpStr.split('\n');
for (var idx=0; idx<tmpLines.length-1; idx++) {
if (delimeter!='') {
tmpLines[idx] = tmpLines[idx].replace(delimRegEx,'\'');
}
//alert(tmpLines[idx]);
zipArray[idx] = new Array();
var tmpArr = tmpLines[idx].split(',');
zipArray[idx] = tmpArr;
}
function showZipArray() {
var output='';
for (var idx=0; idx<zipArray.length; idx++) {
for (var jdx=0; jdx<zipArray.length; jdx++) {
switch(jdx) {
case 0:
output += 'Zip Code= '+ zipArray[idx][jdx];
break;
case 1:
output += '; Latitude= '+ zipArray[idx][jdx];
break;
case 2:
output += '; Longitude= '+ zipArray[idx][jdx] + '</br>';
break;
}
}
}
return output;
}
//-->
</script>
...
<body>
<div id="content"><script type="text/javascript">document.write(showZipArray());</script></div>
</body>
...