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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:49:33+00:00 2026-05-16T22:49:33+00:00

Im trying to load an xml file using the jquery ajax function,it works fine

  • 0

Im trying to load an xml file using the jquery ajax function,it works fine in safari but fails in IE6,is there any reason why this the case?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" type="text/css" media="all" href="style.css" />
        <script type="text/javascript" src="jquery.js"></script>
        <title>Reading XML with jQuery</title>
         <script>
            $(document).ready(function(){
                $.ajax({
                    type: "GET",
                    url: "sites.xml",
                    dataType: "xml",
                    success: function(xml) {
                        $(xml).find('site').each(function(){
                            var id = $(this).attr('id');
                            var title = $(this).find('title').text();
                            var url = $(this).find('url').text();
                            $('<div class="items" id="link_'+id+'"></div>').html('<a href="'+url+'">'+title+'</a>').appendTo('#page-wrap');
                            $(this).find('desc').each(function(){
                                var brief = $(this).find('brief').text();
                                var long = $(this).find('long').text();
                                $('<div class="brief"></div>').html(brief).appendTo('#link_'+id);
                                $('<div class="long"></div>').html(long).appendTo('#link_'+id);
                            });
                        });
                    }
                });
            });
         </script>
    </head>
    <body>
        <div id="page-wrap">
            <h1>Reading XML with jQuery</h1>
         </div>
    </body>
    </html>

Thanks

  • 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-16T22:49:33+00:00Added an answer on May 16, 2026 at 10:49 pm

    I have two ideas for you:

    1. I believe some browsers’ xml implementations are case sensitive. make sure your $(xml).find('site') if the xml has <Site> or <SITE> it may not work.

    2. if the sites.xml is a local file, you may have issues loading it with ajax. Try putting it on a webserver as manraj82 suggested

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

Sidebar

Related Questions

I'm trying to load a gzipped XML file using simplexml_load_file() PHP function, but I
I'm trying to parse an XML file using PHP, but I get an error
I'm using jQuery to parse an XML file, and I'm trying to push each
I'm trying to write to an XML file using Builder but cannot seem to
Trying to cache an xml file using the build in wordpress function called get_transient
I am trying to load an XML file onto my GUI using a TreeView
What I'm trying to do is simple. Load am XML file using ElementTree so
I am trying to load an XML file that asks for a username and
I'm trying to load an XML file with a list of books, I looked
I'm trying to load a simple Xml file (encoded in UTF-8): <?xml version=1.0 encoding=UTF-8?>

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.