Skip to content

Instantly share code, notes, and snippets.

@ueokande
Created February 22, 2017 23:07
Show Gist options
  • Save ueokande/5e517ce168ccd7d2fd8031663a80d7c4 to your computer and use it in GitHub Desktop.
Save ueokande/5e517ce168ccd7d2fd8031663a80d7c4 to your computer and use it in GitHub Desktop.
function waitForKintone(success, error, timeout) {
const startAt = new Date().getTime();
function recursive() {
if (window.hasOwnProperty('kintone')) {
console.log("has kintone");
func();
} else if (new Date().getTime() - startAt > timeout) {
console.log("not has kintone");
error();
} else {
console.log("continue...");
setTimeout(recursive, 1000);
}
}
recursive();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment