异步
for (var index = 0; index < data.length; index++) {
var req = http.request(urlEntity, function(res) {
var content = "";

res.on("data", function(data) {
content += data;
});
res.on('end', function() {
// 获取到数据
......
});

});

req.on("error", function(e) {
if(e){
console.info(e);
// 遇到异常
}
});
}

//往下执行
同步
var data = [];
(function getdata(index) {
if(index>=data.length) return true;

var queryUrl = data[index];
var req = http.request(urlEntity, function(res) {
var content = "";

res.on("data", function(data) {
content += data;
});
res.on('end', function() {
//do something u want!
getdata(index+1);
});

});

req.on("error", function(e) {
if(e){
console.info(e);
}
});
})(0)

xxxxxxxxx的更多相关文章

  1. sqlserver 插入数据时异常,仅当使用了列列表并且 IDENTITY_INSERT 为 ON 时,才能为表'XXXXX.dbo.XXXXXXXXX'中的标识列指定显式值。

    INSERT INTO XXXXXXXXX.dbo.XXXXXXXXX select * from XXXXXXXXX 仅当使用了列列表并且 IDENTITY_INSERT 为 ON 时,才能为表'X ...

  2. 模块"xxxx.dll"已加载,但对DllRegisterServer的调用失败,错误代码为 XXXXXXXXX

    WIN7.WIN8  注册 卸载dll  报错: 模块"xxxx.dll"已加载,但对DllRegisterServer的调用失败,错误代码为 XXXXXXXXX 解决方法: 若为 ...

  3. 解决 “access violation at address xxxxxxxxx”错误

    在进行磁盘整理的时候,打开Foxmail的时候出现了“access violation at address32383137”错误 和“access violation at address00000 ...

  4. asp.net程序集冲突解决笔记(未能加载文件或程序集"XXXXXXXXX")

    先来看张截图.(未能加载文件或程序集”System.Web.Razor“) 先说一下我的情况.(扯蛋的,解决方法还在下面 —> _ < ) 这是 ASP.NET MVC 的东西.老大写了一 ...

  5. JMeter 连接数据库报错No suitable driver found for jdbc:xxxxxxxxx

    添加JDBC Connection Configuration 和 JDBC Request 组件,添加相关信息 注意两个组件里面输入的Variable Name 必须一致 运行查看结果树出现如下错误 ...

  6. 安装插件出现eclipse An internal error occurred during: "Installing Software". xxxxxxxxx

    就是你自己本来就有那个插件了 百度怎么删吧.... 看一下我这个文章 强烈建议本地安装的时候用第四种安装 http://www.cnblogs.com/ydymz/articles/7203260.h ...

  7. SharePoint 已在此服务器场中安装 ID 为 XXXXXXXXX 的功能。请使用强制属性显式地重新安装此功能。解决方法

    图1: 图2: 解决方法: stsadm -o deploysolution -name ***.wsp -immediate -allowGacDeployment -url http://*** ...

  8. System.Runtime.InteropServices.COMException 检索COM类工厂中CLSID{xxxxxxxxx}的组件时失败解决方法

    iis7.5中设定应用程序池中<进程模型>中<标识>为localSystem 提示:System.Runtime.InteropServices.COMException: 命 ...

  9. Could not find conduit initiator for address:xxxxxxxxx and transport: http://schemas.xmlsoap.org/soap/http

    <properties> <cxf.version>3.1.12</cxf.version> </properties> <dependencie ...

随机推荐

  1. jqgrid如何在一个页面点击按钮后,传递参数到新页面

    利用 Content/Scripts/dw-framework.js 中的AddTableMenu属性 <div class="Task" style="backg ...

  2. 夺命雷公狗-----React---13--事件监听

    在react中事件监听直接作为组建的属性来添加即可,就像DOM中的html操作 <!DOCTYPE> <html> <head> <meta charset= ...

  3. 【003:ubuntu 基本开发环境设置】

    1.基础开发环境 sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install Oracl ...

  4. 《zw版·Halcon-delphi系列原创教程》 Halcon分类函数008,matrix,矩阵函数

    ** 3dFromFundamentalMatrix( Rows1, Cols1, Rows2, Cols2, CovRR1, CovRC1, CovCC1, CovRR2, CovRC2, CovC ...

  5. html5,表单与label标签配套使用

    <form action=""><input type="checkbox" name="dx" value=" ...

  6. angularjs与require的集成摘抄

    基于requireJS和angularJS的前端技术架构 :http://blog.163.com/liuyong_xiaxia/blog/static/17435525520156341446981 ...

  7. 机器学习实战-边学边读python代码(3)

    程序清单2-3 归一化特征值: def autoNorm(dataSet): /* >>> barray([[ 1., 2., 3.], [ 2., 3., 4.], [ 10., ...

  8. Linux内核内存管理子系统分析【转】

    本文转载自:http://blog.csdn.net/coding__madman/article/details/51298718 版权声明:本文为博主原创文章,未经博主允许不得转载. 还是那张熟悉 ...

  9. CSS3 笔记一(Rounded Corners/Border Images/Backgrounds)

    CSS3 Rounded Corners The border-radius property is a shorthand property for setting the four border- ...

  10. Dynamics AX 2012 R2 将系统用户账号连接到工作人员记录

    要使用AX中的一些特性,需要将User Account和他们的Employee Record连接在一起.最好将所有Employee的User Account,都和他们的Employee Record连 ...