nodejs 一樣的代碼,我的為什么就不出結(jié)果了
為什么我的代碼跟老師一樣,卻不出結(jié)果了?
var http = require('http');
var url = 'http://idcbgp.cn/learn/348';
http.get(url, function(res){
?? ?var html = '';
?? ?res.on('data',function(data){
?? ??? ?html += data;
?? ?});
?? ?res.on('end',function(){
?? ??? ?console.log(html);
?? ?});
}).on('error',function(e){
?? ?console.log('獲取課程數(shù)據(jù)出錯:'+e.message);
});
2016-04-18
我也是,啊為什么呢?
2015-11-11
我也遇到同樣的問題