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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:33:27+00:00 2026-05-13T08:33:27+00:00

I’m trying to extract values from xml using jQuery in a cross-browser compatible fashion.

  • 0

I’m trying to extract values from xml using jQuery in a cross-browser compatible fashion. I’m not having any issues doing this in firefox, but unfortunately this also has to be IE compatible.

My jQuery code looks like this:

$(document).ready(function()) {
  $.get("file.xml", {}, function(parseRefreshTime){
    alert('This line is executed in IE.');  
    $("created", parseRefreshTime).each(function() {
      alert('This line is *not* executed in IE.');  
      refreshTime = $(this).text();
      //do stuff with refreshtime
    });
  });
});

This extracts the node value for a <created> node in my xml file.

I’m referencing the jQuery library in my page, and it’s parsing properly in Firefox, so I’m assuming that that my parsing code is appropriate. I get both alerts in Firefox, but only the first one in IE.

I could swear I had very similar code working yesterday, but I must have tweaked something and somehow broken it. After fighting with it for almost an hour now, I’m looking for another set of eyes.

Can anyone spot what I’m doing wrong here?

  • 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-13T08:33:27+00:00Added an answer on May 13, 2026 at 8:33 am

    A few things:

    • Specify the response type as xml for your AJAX request
    • Wrap the returning XML object in $(doc) and use find to query the XML
    • I think you have a few typos in your first line: reader should be ready and you have an extra closing parentheses

    This is working for me on IE6. If this doesn’t work for you, you may want to look into whether you are serving up your xml properly.

    index.html:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Test</title>
    
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
      <script type="text/javascript" charset="utf-8">
        $(document).ready(function() {
          $.get("test.xml", null, function(doc) {
            $(doc).find('created').each(function() {
              alert($(this).text());
            })
          }, 'xml');
        });
      </script>
    </head>
    <body>
    
    </body>
    </html>
    

    test.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <created>2010-01-07 00:00:00</created>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer endl is a strange beast. It isn't a constant value.… May 14, 2026 at 7:23 pm
  • Editorial Team
    Editorial Team added an answer I checked our billing database. We use Asterisk as PBX… May 14, 2026 at 7:23 pm
  • Editorial Team
    Editorial Team added an answer You should try opening /dev/tty directly. That's the only way… May 14, 2026 at 7:23 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

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.