# 问题描述 请在下列代码片中,找出globalData的错误使用方法? ## 答案 ``` javascript onLaunch() { getApp().globalData.username = 'csdn' } ``` ## 选项 ### A ``` javascript onLaunch() { this.globalData.username = 'csdn' } ``` ### B ``` javascript onLoad() { getApp().globalData.username = 'csdn' } ``` ### C ``` javascript onShow() { getApp().globalData.username = 'csdn' } ``` ### D ``` javascript onHide() { getApp().globalData.username = 'csdn' } ```