I am changing the src attribute of an image element. If there's an error I want to know the error status code.
How can I retrieve image error code using JavaScript or jQuery?
208 Views Asked by shasabbir At
2
I am changing the src attribute of an image element. If there's an error I want to know the error status code.
You could adapt this source example on mdn web docs. If you change the
srcattribute programmatically and need to check first if it gives an error code, it could do the job. Here a draft, I hope this is going to help you.