var http=require("http");
var url="http://www.imooc.com/view/637";
http.get(url,function(res){var html="";res.on("data",function(data){html+=data})
res.on("end",function(){
console.log(html);
})
}).on("error",function(){
console.log("错误!");
})运行之后直接进了error,求解释
var url="http://www.imooc.com/view/637";
http.get(url,function(res){var html="";res.on("data",function(data){html+=data})
res.on("end",function(){
console.log(html);
})
}).on("error",function(){
console.log("错误!");
})运行之后直接进了error,求解释
2016-06-27