8.20 LAB: Circle with a Promise The given web page displays a growing orange circle when the Show Circle button is click

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

8.20 LAB: Circle with a Promise The given web page displays a growing orange circle when the Show Circle button is click

Post by answerhappygod »

8 20 Lab Circle With A Promise The Given Web Page Displays A Growing Orange Circle When The Show Circle Button Is Click 1
8 20 Lab Circle With A Promise The Given Web Page Displays A Growing Orange Circle When The Show Circle Button Is Click 1 (34.82 KiB) Viewed 36 times
8.20 LAB: Circle with a Promise The given web page displays a growing orange circle when the Show Circle button is clicked. Your goal is to show a text message inside the circle as show below, by creating callbacks for a Promise object Show Circle Ta da! The circle is file contains a click event handler showCircleClick() for the Show Circle button that calls showCircle() to display the orange circle. The showCircle() function returns a Promise object that may be fulfilled or rejected. • The promise is fulfilled in one second if showCircle() is not called a second time before the second elapses The promise is rejected if showCircle() is called a second time before the second elapses Modify the showCircleClick() to call showCircle() and handle the fulfilled or rejected callbacks using the returned Promise's then() method • If the promise is fulfilled, the <div> containing the circle is passed to the callback function. The message "Ta dal" should be added to the <div>'s innerHTML If the promise is rejected, an error message is passed to the callback function. The error message should be displayed using alert(). If your modifications are written correctly, you should see the "Ta da" message appear one second after the Show Circle button is clicked. If you click Show Circle twice quickly, you should see the error message appear in the alert dialog box, as shown below. Show Circle This page says showCircle called too soon CK
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply