All,
I wasn't sure if this got lost in the shuffle of my first post. Does anyone 
know why the following works under FF and not under IE7? There are comments 
within the code to explain what I'm seeing. Sorry, I don't have an external 
facing website on which to post this.

Doug


From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of Knight, Doug
Sent: Monday, August 31, 2009 2:35 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Newbie: Cannot get .text() to work with IE7

All,
I'm new to jQuery, but not JavaScript. I have the following really simple html 
file with jQuery-based JavaScript to open, read and display part of an xml 
file. It works fine on FF 3.5.2, but does not work on IE7. Am I missing 
something really simple to make jQuery work on IE7? Any help would be great, 
thanks!

Doug Knight

Here's the html/JavaScript:

<html>
                <head>
                                <title>Read XML</title>
                                <script src="lib/jquery.js" 
type="text/javascript" charset="utf-8"></script>
                                <script type="text/javascript" charset="utf-8">
                                jQuery(function(){
                                //$(document).ready(function(){

                                                
jQuery.get("test.xml",{},function(xml){
                                                
//$.get("test.xml",{},function(xml){

                                                                DBArea = '';
                                                                // This 
displays the values from the XML file
                                                                DBArea += "xml 
= :" + xml + ":\n";
                                                                // I get blanks 
here
                                                                DBArea += 
"$(xml).text() = :" + $(xml).text() + ":\n";
                                                                // The 
following gives [Object Object]
                                                                ph_sites = 
$(xml).find('product_header_sites');
                                                                DBArea += 
"ph_sites = :" + ph_sites + ":\n";
                                                                // And the 
following gives blanks too
                                                                ph_sites = 
$(xml).find('product_header_sites').text();
                                                                DBArea += 
"ph_sites = :" + ph_sites + ":\n";

                                                                // Update the 
DIV called Content Area with the HTML string
                                                                
$("#DebugArea").append("<pre>" + DBArea + "</pre>");
                                                });
                                });
                                </script>
                </head>
                <body>
                <div id="DebugArea"></div>
                </body>
</html>

And here's the XML file:

    <text_msg>
        <product_header>
            <product_header_site_id>255</product_header_site_id>
            <product_header_node>191</product_header_node>
            <product_header_byte_count>332</product_header_byte_count>
            <product_header_product_type>2</product_header_product_type>
            <product_header_product_status>0</product_header_product_status>
            <product_header_sites>F90</product_header_sites>
        </product_header>
    </text_msg>


Reply via email to