My js code
CodePudding user response:
The so-called global variables, is that there is no other functions or scope of variables,
You can directly in the ajax method returns with the window. The reData=https://bbs.csdn.net/topics/result; This way the assignment,
Can also be defined in the external variables, then the assignment:
Var reData;
Ajax (... , the function (result) {
RecordData=https://bbs.csdn.net/topics/result;
})
CodePudding user response:
Directly in front of the js, define a variable is a global variable, and then gave him the assignment can be in local
CodePudding user response:
Build var to convert into the let, more rigorous, after all version changed,
CodePudding user response: