这 2 行代码是什么意思(*来自教程)?
我试图理解本教程中调用函数的方式 http://docs.phonegap.com/en/1.3.0 /phonegap_storage_storage.md.html#SQLResultSetList
(*我尝试用谷歌搜索回调函数,但仍然没有得到这些)
最后有 db.transaction(populateDB, errorCB, successCB); 这是否意味着它将调用函数 populateDB ,如果失败则调用 errorCB ,如果成功则调用 successCB ?或者函数调用的顺序是什么?
然后上面有
tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
[] 是什么意思?再说一遍,现在 querySuccess 调用的函数序列在 errorCB 之前(与 Q1.case 不同)?
I am trying to understand the way functions are called in this tutorial
http://docs.phonegap.com/en/1.3.0/phonegap_storage_storage.md.html#SQLResultSetList
(* I tried googling about call back function but still don't get these )
at the end there is
db.transaction(populateDB, errorCB, successCB);
does that mean it will call function populateDB and if it fails it call errorCB and if it success it call successCB ? or what are the sequence of the function calls ?Then upper to that there is
tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
What does [ ] mean ? And again what is the sequence of function called as now querySuccess is before errorCB ( unlike the Q1. case ) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
但请检查这些函数的 api 文档( 交易 和 executeSql) 查看每个参数的用途,它应该告诉您目的每个参数的
but check the api documentation for those functions (transaction and executeSql) to see what each argument is for, it should tell you the purpose of each argument