SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Sep 2001
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery xml parsing help

    hey folks,

    check out www.craniumdesigns.com/new

    please look at the code and tell me why the parsed xml is not being appended inside the web portfolio area. i am new to jquery and can't figure this out. thanks

    Code JavaScript:
    jQuery(function( $ ){
     
                //xml parsing for portfolio
                $.ajax({ 
                    type: "GET",
                    url: "port_web.xml",
                    dataType: "xml",
                    success: function(xml) {
     
                        var _name = "";
                        var _url = "";
                        var _image = "";
                        var _desc = "";
     
                        $("/portfolio/job", xml).each(function(){
     
                            _name = $("name", this).text();
                            _url = $("url", this).text();
                            _image = $("image", this).text();
                            _desc = $("desc", this).text();
     
                            $("#tabPortfolioWeb ul").append("Name: " + _name + "<br />Description: " + _desc);            
     
                        });
                    }
                });
            });
    Steve Davis

  2. #2
    SitePoint Guru whisher's Avatar
    Join Date
    May 2006
    Location
    Kakiland
    Posts
    732
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi.
    It's better off you post also your xml file.
    May be

    Bye.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2001
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind. i fixed it anyways. figure out it was an xpath issue cuz its not included with the newer versions of jquery.
    Steve Davis

  4. #4
    SitePoint Addict
    Join Date
    Sep 2001
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, so everything was working fine locally on my computer, and i go to upload it, and now none of the xml data is parsing. i uploaded the exact structure! what's going on?

    www.craniumdesigns.com/new
    Steve Davis

  5. #5
    SitePoint Addict
    Join Date
    Dec 2007
    Posts
    207
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Firefox's error console tells me that you are using those weird ms quotes.

    Code:
    <?xml version=&#226;€1.0&#226;€&#179; encoding=&#226;€utf-8&#226;€&#179; ?>

  6. #6
    SitePoint Addict
    Join Date
    Sep 2001
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks. works fine now. the quote symbols weren't typed in right.
    Steve Davis


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •