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 get(url) { | |
return new Promise((resolve, reject) => { | |
// Lấy hình từ gái xinh.com | |
// Nếu bị lỗi thì đành thất hứa | |
if (error) reject("Error"); | |
// Nếu lấy được thì thực hiện lời hứa | |
resolve(xxxImage); | |
}); | |
} | |
var promise = ajax.get("gaixinh.info"); | |
// Có hình thì fap, không có thì alert lỗi | |
promise | |
.then(image => fap) | |
.catch((error) => alert(error)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment