Hello, there is some picture by URL. How can you determine from javascript whether it really exists? Thank!

    2 answers 2

    If on your server - make ajax request and analyze the response code.

    Otherwise, <img src = "..." onload = "{picture_est}" alt = "" />

      onerror

      Performs JavaScript if an error occurs while loading the image

      object.onerror="SomeJavaScriptCode"