Simple jQuery AJAX XML load not working

jsuckling

New Member
I'm just trying to load some simple XML data using AJAX, but it has no effect, and I can't for the life of me find the error. Any help is appreciated. Here's the code:For the page:\[code\] <html> <head> <title>Big Skinny Wallet Helper</title> <style> #nav { position:absolute; left:0px; width:300px; background-color:#b0e0e6; } #content { position:absolute; left: 300px; } </style> <script src="http://code.jquery.com/jquery-latest.js"></script </head> <body> <div id="nav"> This is text on the left. <form> <input type="radio" name="gender" class="gender" id="male" value="http://stackoverflow.com/questions/15641320/male">Male<br /> <input type="radio" name="gender" class="gender" id="female" value="http://stackoverflow.com/questions/15641320/female">Female<br /> </form> </div><div id="content">This is the main content area.</div><div></div><script>$(document).ready(function() {$.get('wallets.xml', function(data) { $('#content').empty(); $(data).find('wallet').each(function() { var $wallet = $(this); var html = '<div class="wallet">'; html += '<h3 class="name">' + $wallet.attr('name'); html += '</h3>'; html += '</div>'; $('#content').append($(html)); });});});</script></body></html>\[/code\]For the XML:\[code\]<?xml version="1.0" encoding="UTF-8"?><wallets><wallet name="Compact Sport" material="nylon" gender="male"> <description> This is the latest bi-fold wallet in our series of super thin and light sport wallets featuring four card pockets. Since most people only use 4-6 cards regularly, just use the front two pockets for those cards and stack & store all those other cards in the hidden 2 storage pockets--go minimalist by keeping your material layers to a minimum. The favorite thin wallet used every single day by the Big Skinny founder. </description></wallet><wallet name="Curve" material="nylon" gender="male"> <description> Front pocket wallet-carriers, this is the model for you! We hate the state the obvious, but hey, it's fun: the curve is designed with two-rounded edges to fit neatly in your front or back pants pocket. Crafted from tough, machine-washable, nylon micro-fiber, this ultra thin wallet can hold about 20 plastic cards and cash. The pockets and billfold area are lined with a rubbery coating to help prevent your goods from sliding out: smart! </description></wallet></wallets>\[/code\]
 
Back
Top