我有以下资源:
测试.js
var gblData;
function getData(){
//webservice to set value to gblData
}
react jsx 文件
//use the gblData to render the html page
html文件
我尝试了以下方法在 jsx 文件之前调用 getData() 以便 gblData 不是未定义的。但它失败了。
1 html body onload 函数
2 jquery 文档准备好