同步API Sync API
为确保您的代码在RevIQ脚本加载完成后执行,您可以使用reviq 命令队列。
To ensure that your code runs after the RevIQ script is loaded, you can use the
reviq command queue.
RevIQ脚本采用异步加载方式,以避免阻塞页面渲染。请务必确认API已就绪后再进行调用。
The RevIQ script loads asynchronously in order to not block the page. It’s
important to make sure that the API is ready before you call it.
Using Command Queue
Using Command Queue
index.js
Using Promise
Using Promise
您也可以创建一个Promise,在首次调用
reviq 命令后resolve。
Alternatively, you can create a Promise that resolves after the first reviq
command is called.index.js