我现的的CSV文件叫a.csv,里面全存的是E-mail地址,想全读出来,但我没做过JS,不会写这样的函数,哪位高手能帮我写写看,我研究一下,谢谢了。
CSV文件路径D:\www\a.CSV
谢谢了哈
[b]问题补充:[/b]
好像kimmking的做不出来啊,我是要这样,如CSV文件里的内容是
123@123.com;
345@126.com;
adfg@163.com;
adfag@qq.com;
最后我要取到的是这样,
email=123@123.com;345@126.com;adfg@163.com;adfag@qq.com;
谁能帮写写看,我从没做过这个东西,JS只做过前台页面的效果。不明白这个
[b]问题补充:[/b]
fso = new ActiveXObject("Scripting.FileSystemObject");
ts = fso.OpenTextFile(GO.settings.modules.files.url + "jupload/index.php?path=" + encodeURIComponent(this.path));
email_item = ts.ReadAll();
ts.Close();
这是我的部分代码,但是不兼容,别的浏览器下怎么能兼容呢?
[b]问题补充:[/b]
if(window.ActiveXObject)
{ //IE浏览器 开始初始化XMLHttpRequest 对象
try
{
//http_request=new ActiveXObject("Msxml2.XMLHTTP");
fso = new ActiveXObject("Scripting.FileSystemObject");
ts = fso.OpenTextFile(GO.settings.modules.files.url + "jupload/index.php?path=" + encodeURIComponent(this.path));
email_item = ts.ReadAll();
ts.Close();
}
catch(exception){
http_request=new ActiveXObject("Microsoft.XMLHTTP");
}
}else{ //Mozilla 浏览器---window.XMLHttpRequest
fso = new XMLHttpRequest("Scripting.FileSystemObject");
ts = fso.OpenTextFile(GO.settings.modules.files.url + "jupload/index.php?path=" + encodeURIComponent(this.path));
email_item = ts.ReadAll();
ts.Close();
}
受你的启发,了解一点AJAX,所以我这样来写,应该是的吧。嘿嘿