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 599211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:28:24+00:00 2026-05-13T16:28:24+00:00

Fetch a URL – mywebiste.com/blah.php –> returns 404 Fetch a URL – mywebsite.com/blah.php –>

  • 0

Fetch a URL – mywebiste.com/blah.php –> returns 404

Fetch a URL – mywebsite.com/blah.php –> returns 404

Fetch a URL – mywebsite.com/blah.php –> returns 404

Fetch a URL – mywebsite.com/blah.php –> returns 200 // how do I loop until this the URL returns 200?

Previously phrased:

So I have a URL (foo) that I need to download after my page has finished rendering or the
element that I want to show it in is on the page i.e. I’ll call this function that I’m asking about from my element.

The problem is I have to keep downloading the URL until it returns 200, it starts of saying 404, and gives 200 and a bunch of other headers, once it’s done.

Can anyone think of a quick and easy way of doing this? I’m sort of brain-dead @ 2:50AM 🙁

  • 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-05-13T16:28:25+00:00Added an answer on May 13, 2026 at 4:28 pm

    Try something like this – load the page, and try again and again on error. Make sure to add the rest of the arguments to ajax. You can add a check to load only on error code 404:

    function tryLoad
        $.ajax({
            url: 'url',
            success: function(data){ /* handle load */ },
            error: function(XMLHttpRequest, textStatus, errorThrown){
                setTimeout(tryLoad, 1000); //try again later
            }
        });
    }
    

    Of course, this will load indefinitely if you have a real error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my script: var Url = 'http://readonline.egscans.com/Remnant/Chapter_036_[END]'; var response = UrlFetchApp.fetch(Url).getContentText(); I get this error
i need to fetch a url with javascript/jquery and not php. i've read that
I understand how to fetch a URL text page and loop over the results
I have one million URL list to fetch. I use this list as nutch
For some reasons this part where I fetch JSON data from following url will
class sss(webapp.RequestHandler): def get(self): url = http://www.google.com/ result = urlfetch.fetch(url) if result.status_code == 200:
I'm using URL Fetch Java API http://code.google.com/appengine/docs/java/urlfetch/overview.html#Fet ... to get information from graph.facebook.com, however,
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml , reason: Connection timed out: connect I've encountered above
Im using curl through php to fetch a url. I am successfully able to
this is my code: url = /aa result = urlfetch.fetch(url) but it will be

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.