Created
February 22, 2017 23:07
-
-
Save ueokande/5e517ce168ccd7d2fd8031663a80d7c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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