Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:46:39+00:00 2026-06-12T17:46:39+00:00

I am working with a servlet which serves up an image. However, it takes

  • 0

I am working with a servlet which serves up an image. However, it takes about 30 seconds for this to be generated. When complete, it appears on an OpenLayers interactive map.

I am trying to figure out a way for the user, who is at http://www.test.com to get confirmation the image is being processed or is complete, which is located at http://www.test2.com. If I open test2.com, I can see that the page is trying to load. When complete, the image also appears on my map on test.com.

However, I can’t figure out how to test if this image exists or not. I am looking for something probably like

    if(image exists at http://test2.com) {alert("request is done");

or possibly

    if(http://test2.com is loading) {doing something);

I just don’t want the user sitting by if the request fails. If it fails, the url will complete its load – however, no image will appear. Any guidance will be very appreciated! Thanks!

Kyle

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:46:40+00:00Added an answer on June 12, 2026 at 5:46 pm

    If it is a different server, JavaScript will not be able to make any type of Ajax request to that server to see if it exists. You would have to have a proxy on the local domain which could make a head request to the second domain.

    If you are waiting until the image is loaded to work with it, you can always do an image preloader, but that will take the full time for the image to render before the onload event fires.

    var img = new Image();
    img.src = theUrl;
    img.onload = function() {
        nextStep(this);
    };
    img.onerror = function() {
         imgLoadingError(this);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a servlet (runs on tomcat) which receives requests that contains
I am working on a web service servlet running on Google App Engine using
I'm busy working on a windows phone application that calls a servlet that then
I'm working on a small django project that will be deployed in a servlet
I have a servlet. But it is not working as desired. Hence for debugging
I am trying to implement a simple login servlet but it's not working properly.
I'm working with Tomcat7 on JSF 2.17 Mojarra. I'd like to place a servlet
I'm working on an application. I have a servlet (writeDataBase.class) that writes some information
Some code a production server which uploaded files has seemingly stopped working with the
Am working on an application which has a requirement to download bulk data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.