Failed to load resource: the server responded with a status of 404 (Not Found):How to Handle error if iframe src gives 404 Error in React

297 views Asked by At

I have been digging deep regarding i-frames. I am stuked at point i can't get error code when i-frame failed to load something. and Every time i am getting only error, without any access of it, "Failed to load resource: the server responded with a status of 404 (Not Found)".

Can Anybody tell me how can i get an proper error object and use it to display custom message?

<iframe
  className="responsive-div"
  id="iframe-test"
  onLoad={(e) => {
    console.log("first".e);
  }}
   src={URL}
>
0

There are 0 answers