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

  • Home
  • SEARCH
  • 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 707597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:17:45+00:00 2026-05-14T04:17:45+00:00

I want to use javascript / jquery to determine if an xml file exists.

  • 0

I want to use javascript / jquery to determine if an xml file exists.
I don’t need to process it; I just need to know whether it’s available or not,but I can’t seem to find a simple check.

Here is what I’ve tried:

 jQuery.noConflict();

  jQuery(document).ready(function(){
    var photo = '223';
    var exists = false;

    jQuery.load('/'+photo+'.xml', function (response, status, req) { 
      if (status == "success") { 
        exists = true;
      }
    });
  });
  • 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-14T04:17:46+00:00Added an answer on May 14, 2026 at 4:17 am

    Assuming you are talking about an xml file on the server, you could do a ajax request and then write a custom error handler to check the error response message. You’ll need to know what the exact error message code is for a missing file (usually 404). You can use Firebug Console to check what the exact error message and code is.

    $.ajax({
         type: "GET",
         url: "text.xml",
         dataType: "xml",
         success: function(xml) {
            alert("great success");
         }, 
         error: function(xhr, status, error) {
            if(xhr.status == 404)
            {
                alert("xml file not found");
            } else {
                //some other error occured, statusText will give you the error message
                alert("error: " + xhr.statusText);
            }
         } //end error
     }); //close $.ajax(
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 518k
  • Answers 518k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); Output just generated: 19/09/2010 19:31:20 Just so you… May 16, 2026 at 8:17 pm
  • Editorial Team
    Editorial Team added an answer Better way to deal this is to split each of… May 16, 2026 at 8:17 pm
  • Editorial Team
    Editorial Team added an answer Now, jqGrid can do this - finally, oh yeah! So… May 16, 2026 at 8:17 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Below is my HTML and CSS. I want to use javascript to determine when
I want to determine the best javascript framework to use in order to maintain
I can't use JQuery sadly I need to use good old Javascript. I have
I want use jQuery in my project. I know the javascript_include_tag calls the jQuery
Take a case, I want to use multiple javascript libraries into one page like
I'm new to JQuery and want to use it to display a simple volume
I have a multi-lingual page where I want to display form validation error in
I have written a set of javascript functions that allow me to validate user
Like the title says, what's the best way in JavaScript to get all radio
Let's say I have a PHP page and inside that PHP page I just

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.