Promise example

Developer
Size
2,343 Kb
Views
20,240

How do I make an promise example?

Promises enable asynchronously dependent functionality with an easy to read API.. What is a promise example? How do you make a promise example? This script and codes were developed by Coran Spicer on 15 October 2022, Saturday.

Promise example Previews

Promise example - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Promise example</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <input type="text" name="From:" placeholder="Please enter your name" id="love" />
<input type="submit" onclick="triggerPromise()" >
<iframe id="fuckoffcontainer" ></iframe> <script src='https://www.promisejs.org/polyfills/promise-7.0.4.min.js'></script>
<script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Promise example - Script Codes CSS Codes

#love { display: block; position: relative; padding: 0.5rem 1rem; text-align: left;
}
#fuckoffcontainer { display: block; position: relative; opacity: 0; width: 100%; height: 300px; border: 0; transistion: opacity 0.3s ease-out;
}
#fuckoffcontainer.visible { opacity: 1;
}

Promise example - Script Codes JS Codes

function triggerPromise() { var from_name = $('#love').val(); // declare some functionality var jQueryPromise = $.ajax('https://www.foaas.com/off/Coran/'+from_name); var realPromise = Promise.resolve(jQueryPromise); realPromise.then( function(res) { var iframe = document.getElementById('fuckoffcontainer'); iframe.contentWindow.document.open() iframe.contentWindow.document.write(res); $('#fuckoffcontainer').addClass('visible'); });
};
Promise example - Script Codes
Promise example - Script Codes
Home Page Home
Developer Coran Spicer
Username cgspicer
Uploaded October 15, 2022
Rating 3
Size 2,343 Kb
Views 20,240
Do you need developer help for Promise example?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Coran Spicer (cgspicer) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!