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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:25:37+00:00 2026-06-14T04:25:37+00:00

Perform cross domain query, how to perform a certain function if the URL on

  • 0

Perform cross domain query, how to perform a certain function if the URL on which it is running is not available (404)?
I try something like this:

$.getJSON({
url:'example.php?callback=?',
statusCode: {
404:function(){alert('404');}
},
success :function(data){//do stuff}
});
  • 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-14T04:25:38+00:00Added an answer on June 14, 2026 at 4:25 am

    Matt posted a great answer in this question that may solve your issue.

    You will have to add a success property on your JSON object

    var success = false;
    
    $.getJSON(url, function(json) {
        success = true;
        // ... do what you need to do here
    });
    
    // Set a 5-second (or however long you want) timeout to check for errors
    setTimeout(function() {
        if (!success)
        {
            // Handle error accordingly
            alert("Yup, 404"); // string was "Houston, we have a problem."
        }
    }, 5000);
    

    KeYan makes a good suggestion by checking the XHR status property if you aren’t expecting timeout issues. I would vote his solution up, but I lack the rep points.

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

Sidebar

Related Questions

I need to use YQL (Yahoo Query Language) to perform a cross domain ajax
I am using the JSONP/dynamic-script-tag technique to perform cross-domain AJAX (There's no XML, but
Is there a way without using a server proxy to perform a cross domain
Is it even possible to perform a cross-domain POST Ajax request without using proxy?
I would like to spawn off threads to perform certain tasks, and use a
I'd like to perform the expensive operation of cross product across two data sets
I perform this kind of query in my Python code to conn = rdbms.connect(instance=_INSTANCE_NAME,
Notice how Firebug can access the DOM of cross domain iframes and even allow
I am try to get a URL from a one server and using that
So I want an element i.e: <a id=target>click me</a> to perform a JavaScript function

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.