how to handle iframes fail to load | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to handle iframes fail to load

how to handle failed pages loaded in the iframe by displaying an error message or hiding the url loaded in the iframe or in essence the user cannot see the url of the iframe page, for example run my code below offline https://code.sololearn.com/WkwpKPgViOMe/?ref=app

19th May 2020, 3:35 PM
Avirur Rahman
Avirur Rahman - avatar
9 Answers
+ 2
There is no way to test for an error within an iframe.
19th May 2020, 4:26 PM
Calviղ
Calviղ - avatar
+ 2
Ore Adeleye yes, it works but when left in a few seconds the online state closes on its own, do you also experience it or just me
19th May 2020, 5:48 PM
Avirur Rahman
Avirur Rahman - avatar
+ 1
Calviղ is there any other way besides using iframe?
19th May 2020, 4:37 PM
Avirur Rahman
Avirur Rahman - avatar
19th May 2020, 5:10 PM
Ore
Ore - avatar
+ 1
Ore Adeleye thank you for your code but I open it offline still shows success
19th May 2020, 5:26 PM
Avirur Rahman
Avirur Rahman - avatar
+ 1
Avirur Rahman I've edited it. Check now. It works on my device. I am using sololearn app playground https://code.sololearn.com/WDt89r2nBPo1/?ref=app
19th May 2020, 5:37 PM
Ore
Ore - avatar
+ 1
Avirur Rahman That's a really weird bug. I don't know why that happens. I tried the code in firefox and it worked smoothly but does not work on sololearn
19th May 2020, 6:03 PM
Ore
Ore - avatar
+ 1
Ore Adeleye I tried it on my computer but it still doesn't work, I use the Chrome browser and Opera
19th May 2020, 6:26 PM
Avirur Rahman
Avirur Rahman - avatar
19th May 2020, 6:08 PM
Ore
Ore - avatar