猿问

这两个this什么规律

Page({
      onLoad(){
          console.log(this)//this一
          wx.request({
              url: 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg?g_tk=1844339964&uin=3278805836&format=json&inCharset=utf-8&outCharset=utf-8&notice=0', 
 

          success(res) {
            console.log(this)//this二
            
          }
          })
     }
})

这是微信小程序的js脚本。为何第一个this指向page对象;而第二个this又是指向success函数本身?

qq_杀意隆_0
浏览 1175回答 0
0回答

慕瓜9220888

JKAPUHIGGVOGTMFWZFIPJOQGQQKXLUPYLILSZJVHQGJMZPQCBNANQXXMVUKDGJAPRLQZGCPMIWMRPBLOHTYDOZDZQDDZZHNGPMPWHXBTGDZTEQQVOEXUEQPRNFDDANKLDJVZZKNFTIRAHEBOVALOAGZYIZXGVORERKQLDHJMQMJTSFQJCJOHVJFXDDKXAFGMUQJMGTWUTPCPWZGGYJPZEEUEKMWEAJMDARXGIXBKPSVTYAMTPMZHMEWQUHDQDVCRQKDTTOGGIEKNAZTEKGSFXNKQKWLKGMJTIDWDMPCSFGVEQWFEBEAFLHJNMWZJSVRJZWZJCVRXDXVSGXPVNMGOBPHGJWXYLZZOHTTFZDBIUQQMBPKYHWOODNZNHOJIUXDROVGSOXNDYSQKTMBQGAULJWSZIBFTGUHSPLRFZAFPHWSBVZGKQIOONLRLJALOKJMZZCSRSEDDQDGHGJBXQNADNVBTFKXRKTBHSBOWWPVZIRCREHLXWMXEILEYHTIXTXXPTAKHKZNBSMYWKAPAHLNEPMZYIAEVXSOONHLZTXTPOQTVJJTEETJDWXLBTSYDNXBYWUXNNHECWYKTHDKSMQUMMIRBPMNBTZKGOVFJCDNKXARFPZHHHYFZJUFRRRHXICWMVFHXVIWAFUAQFZDROISHKKESWZBZYOEYFJTJUAWSWNHOOTTFVPXBFGBDYOBCPMJUXPSIVCPKENSYHSFDOKKPYORUYOUDFUFQBZBJMSVHYMDNJJCIVFDKOZBGCVICYLRADVLIIQBGVHGJJMMDRXODDQDQHVOGVVYRYRF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