title: ASP.NET MVC invoking webservice through AjaxOptions.Url
body: <p>Say I wanted to invoke the following url that returns Json through an Ajax call:</p>
  
  <p><a href="http://open.mapquestapi.com/nominatim/v1/search?format=json&amp;json_callback=renderBasicSearchNarrative&amp;q=westminster+abbey" rel="nofollow">http://open.mapquestapi.com/nominatim/v1/search?format=json&amp;json_callback=renderBasicSearchNarrative&amp;q=westminster+abbey</a>"</p>
  
  <p>How does on go about doing this?</p>
  
  <p>I tried using the AjaxOptions.Url like this:</p>
  
  <pre><code>&lt;span id="status"&gt;No Status&lt;/span&gt;
  &lt;div&gt;
       @Ajax.ActionLink("Test", null, null, 
                new AjaxOptions 
                {
                    UpdateTargetId = "status",
                    Url = "http://open.mapquestapi.com/nominatim/v1/search?format=json&amp;json_callback=renderBasicSearchNarrative&amp;q=westminster+abbey"
                })
  &lt;/div&gt;
  </code></pre>
  
  <p>but the url does not get invoked when i click on "Test" link.</p>
  
  <p>I also tried:</p>
  
  <pre><code>    &lt;div&gt;
            &lt;button value="get closest POI" onclick="testNominatim()"&gt;&lt;/button&gt;
      &lt;/div&gt;
  
      &lt;script type="text/javascript"&gt;
       function testNominatim() {
              alert("called");
              $.ajax(
                  {
  type: "GET",
                  url: "http://open.mapquestapi.com/nominatim/v1/search?format=json&amp;json_callback=onGetNominator&amp;q=westminster+abbey",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  failure: function (msg) {
                      alert(msg);
                  },
                  success: function (msg) {
                      alert(msg);
                  }                });
  
   function onGetNominator(msg) {
          alert(msg);
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>When I click on button, message box shows but webservice does not get invoked.</p>
  
  <p>I am probably missing something trivial but what is it?</p>
  
  <p>TIA.</p>
  
  <p><strong>Edit 1</strong>  Changes to reflect actual script.   </p>