Why doesn't this function load after a successful ajax call in jquery? <p>I'm using <a href="http://papermashup.com/parse-xml-with-jquery/" rel="nofollow">the tutorial here</a>, that used to work last month, but now it isn't. I've copied the relevant code below.</p> <pre><code>$(document).ready(function () { $.ajax({ type: "GET", url: "http://papermashup.com/demos/jquery-xml/books.xml", dataType: "xml", success: xmlParser }); alert("123"); }); function xmlParser(xml) { alert("456"); $('#load').fadeOut(); $(xml).find("Book").each(function () { $(".main").append('&lt;div class="book"&gt;&lt;div class="title"&gt;' + $(this).find("Title").text() + '&lt;/div&gt;&lt;div class="description"&gt;' + $(this).find("Description").text() + '&lt;/div&gt;&lt;div class="date"&gt;Published ' + $(this).find("Date").text() + '&lt;/div&gt;&lt;/div&gt;'); $(".book").fadeIn(1000); }); } </code></pre> <p>The problem is that the xmlParser() function isn't being called after the successful ajax request. It shows a 123 alert but not a 456 alert. Am I doing something wrong, or is the tutorial wrong?</p> <p>I've included a relevant jsfiddle here. <a href="http://jsfiddle.net/desbest/nwt3unxu/" rel="nofollow">http://jsfiddle.net/desbest/nwt3unxu/</a></p>