当前位置:网站首页>Solve the thirdscripterror error of wechat applet
Solve the thirdscripterror error of wechat applet
2022-07-22 21:27:00 【Cute and strange】
Recently, I got into the pit of wechat applet , A lot of problems , Today's question is thirdScriptError!
The error message is as follows :
Wrong version source code ( Code unrelated to this error has been deleted ):
Page({
data: {
// Used to hold input Input content of
words:null
},
// obtain input Content of input box
input:function(e){
this.setData({words:e.detail.value})
},
// Click button , Print out the contents of the input box in the log
btnclick:function(){
console.log(words)
}
})
Correct source code :
Page({
data: {
words:null
},
input:function(e){
this.setData({words:e.detail.value})
},
btnclick:function(){
// Not directly through words visit !!!!!!!!!
console.log(this.data.words)
},
})
The reason for the error :
Referencing variables in functions requires this Point to !!!
For the first time :
I encountered this mistake again , The reason this time is very retarded , Is in the js When assigning values to variables in the file, you should use colons , I accidentally used the equal sign .
error :
myData: {
username="hello"
}
correct :
myData: {
username:"hello"
}
边栏推荐
- 4.文本编辑器
- Embedded system learning notes
- Character processing command
- 如何做好研发精益需求管理
- Using simple JS to realize arc layout
- Solve the problems that tracepass website cannot be opened and stackoverflow is not fully displayed
- 第一章:minio介绍与安装
- Bash variable -- environment variable
- 物理层2.1
- Nssctf-01-[swpuctf 2021 freshman competition]gift_ F12
猜你喜欢
第四章:minio的presigned URLs上传文件
第二章:minio单机版,使用客户端备份文件
Buuctf entry diary 01 -- easysql
Significance learning record of FFT in MATLAB
BUUCTF闯关日记--[网鼎杯 2020 青龙组]AreUSerialz
Human stars website collection plan -- Michael kerrisk
(7) Vulhub column: log4j Remote Code Execution Vulnerability recurrence
Chapter 2: configure data sources, redis, security, swagger and other tools jar for the project
Leetcode notes (I) backtracking
Buuctf entry diary -- [mrctf2020] how about you (super detailed)
随机推荐
Chapter 6: EASYCODE code generator
8.内存与磁盘管理
JUC-6.2-并发容器-CopyOnWriteArrayList
YOLO9000: Better, Faster, Stronger
JS BOM (browser object model)
[LTTng学习之旅]------Components of LTTng 解构
Buuctf breakthrough diary 02-- [hctf 2018] warmup1
NSSCTF-01-[SWPUCTF 2021 新生赛]gift_F12
Interview shock 67: talk about tcp/ip protocol? And the role of each layer?
RPM package management - Yum online management - IP address configuration and network Yum source
【PyTorch深度学习实践】学习笔记 第三节 梯度下降
Set colSpan invalidation for TD of table
6. Manage servers and services
简单句(Simple sentences)-one
matlab中 FFT 的意义 学习记录
Human stars website collection plan -- Michael kerrisk
Embedded system learning notes
Use vis network to locate the circular toolbar according to the node coordinates
YOLO9000: Better, Faster, Stronger
LeetCode笔记(一)回溯