How to popup the message which is visible in browser's console | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to popup the message which is visible in browser's console

promise.catch(e=> console.log(e.message)); provides me a message in console regarding promise. I want the same message as popup.

9th Nov 2017, 7:37 PM
Ramesh Kasotiya
Ramesh Kasotiya - avatar
2 Answers
+ 2
https://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx You'll want to encode it first, since it most likely contains escape characters in the error message. Hope that helps.
9th Nov 2017, 8:12 PM
AgentSmith
0
Found the solution, use promise.catch(e=> window.alert(e.message);
10th Nov 2017, 8:15 PM
Ramesh Kasotiya
Ramesh Kasotiya - avatar