Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I process XML using JQuery in Internet Explorer?

Posted on 2008-06-12
2
Medium Priority
?
3,165 Views
Last Modified: 2013-12-08
I am experiencing a problem processing a simple xml document using jquery in internet explorer. The idea is to parse selected elements off of the xml document and then append to the DOM. I have it working correctly in Firefox 2, but Internet Explorer 6 SP 2 is raining on my parade. Please see code snippet below for guidance. Thanks in advance.
html and javascript
=========================
<!DOCTYPE html PUBLIC "-//W3C//  DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
 <html>
   <head>
     <meta content="text/xml; charset=iso-8859-1" http-equiv="Content-Type">
     <title>Address book</title>
     <script src="jquery.js" type="text/javascript"></script>
     <script type="application/javascript">
     $(function() {
         $('#update-target a').click(function() {
             $.ajax({
                 type: "GET",
                 url: "label.xml",
                 dataType: "text/xml",
                 success: function(xml) {
                     $(xml).find('label').each(function(){
                         var id_text = $(this).attr('id')
                         var name_text = $(this).find('name').text()
 
                         $('<li></li>')
                             .html(name_text + ' (' + id_text + ')')
                             .appendTo('#update-target ol');
                     }); //close each(
                 }
             }); //close $.ajax(
         }); //close click(
     }); //close $(
     </script>
   </head>
   <body>
     <p>
       <div id='update-target'>
         <a href="#">Click here to load addresses</a>
         <ol></ol>
       </div>
     </p>
   </body>
 </html>
=========================================
xml file
 
<labels>
<label id="mj">
<name>Michael Jordan</name>
</label>
<label id="kb">
<name>Kobe Bryant</name>
</label>
</labels>

Open in new window

0
Comment
Question by:JayKing81
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 375 total points
ID: 21837549
try changing:
<script type="application/javascript">

to:
<script type="text/javascript">
0
 

Author Closing Comment

by:JayKing81
ID: 31466647
I actually figured this out a little while back, but you hit on the head. IE didn't like the application/javascript tag. Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question