close

Uncaught TypeError: Cannot read property 'apply' of undefined.

because you callback mutiple

like 

socket.on('userToUser', function(content, callback){

  mysql.insertChat(content, function(err, data){
      return callback({'result':'1'})   //first callback
  })  
  sendToUser(content, function(errm successData){
      return callback({'result':'success','chatid':content.chatid});
      //second callback ->wrong
  })

});
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 學習程式 的頭像
    學習程式

    程式學習日記,如果我幫助了你請讓我知道

    學習程式 發表在 痞客邦 留言(0) 人氣()