title: Read XML on client side of ASP.NET MVC 4 website
body: <p>I am working on a ASP.NET website and I need to get XML from an <strong>external</strong> url. It works great using ASP.NET MVC's <code>XmlDocument</code> but now I need to parse the XML without going to the server again, so client-side. An example of what I want to do:</p>
  
  <p>Presume we have 3 <code>&lt;select&gt;</code> dropdownlists, the first one contains all carmakes, the second one contains all car models and the third one all types. So, when the page loads, we have the first dropdown with all carmakes and the other two are disabled. When I select a make, I want to load all models of <strong>the selected make</strong> (dropdown nr. 3 still disabled). Then when I select a car model, I want to load all types of <strong>the selected model</strong>.</p>
  
  <p>All makes can be loaded by ASP.NET's <code>XmlDocument</code> which works fine already, but the other data needs to be parsed client-side. I tried this using jQuery:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
          &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(document).ready(function(){
                  $.ajax({
                      type: "GET",
                      url: "-- hidden --",
                      dataType: "xml",
                      success: parseXml
                  });
  
                  function parseXml(xml){
                      $(xml).find("Make").each(function(){
                          $("#output").append($(this).find("carmake").text() + "&lt;br /&gt;");
                      });
                  }
              });
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="output"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But that doesn't work. I read a lot of questions where the sulution was to use <code>crossDomain: true</code> and <code>dataType: jsonp</code> but that doesn't work either. I also read the server I'm getting the XML from needs to support <code>jsonp</code>, but there is no way I can do something about that, because it is not my server but a webservice.</p>
  
  <p>As you may have already seen, the sample-url to get all makes is <code>-- hidden --/make.alx</code>. Then when the user selected a make, I can get the models of the make by sending the carcode in the url, for example: <code>-- hidden --/model.alx?carcode=2</code></p>
  
  <p>So in short the question is: How can I get this working with jQuery if possible and if not, how can I get this working another way? I there a nice way to do this using ASP.NET MVC but without having the whole page reloaded?</p>
  
  <p><a href="http://www.autoweek.nl/" rel="nofollow">This</a> website is a nice example of what I want. As you can see here just under the header you can select a car make, model and type.</p>
  
  <p>Thanks in advance!</p>