title: Ajax call to Restful Web Service
body: <p>I am having an issue trying to recieve a string back from my Restful Web service. 
  My ajax code looks like this
      
  
      </p>
  
  
  
  <pre><code>    &lt;meta http-equiv="Content-Script-Type" content="text/javascript"&gt;
      &lt;script type="text/javascript" src="js/jquery-1.7.2.min.js"&gt;&lt;/script&gt; 
          &lt;script type="text/javascript"&gt;
          function showName(str)
          {   
            if (str=="")
            {
              document.getElementById("playerInfo").innerHTML="Player information will be listed here.";
              return;
            }
  
      var n =  "path/to/jboss"+str;
           document.getElementById("testURL").innerHTML=n;
      $.ajax({
          type: "GET",
          url: n,
          dataType: "html",
          success:function(resp){
               document.getElementById("playerInfo").innerHTML=resp;
          },
          error:function(e){
              document.getElementById("playerInfo").innerHTML="Error: " + e;
          }
      });
      }
  
          &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action=""&gt; 
          &lt;select name="id" onchange="showName(this.value)"&gt;
              &lt;option value=""&gt;Select an id number:&lt;/option&gt;
              &lt;option value="51902"&gt;51902&lt;/option&gt;
              &lt;option value="51907"&gt;51907&lt;/option&gt;
              &lt;option value="51916"&gt;51916&lt;/option&gt;
          &lt;/select&gt;
      &lt;/form&gt;
    &lt;div id="testURL"&gt;&lt;/div&gt;
      &lt;div id="playerInfo"&gt;Player information will be listed here.&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The str that is being passes through is the parameter for my application on that page. It is suppose to return an HTML String but it always goes to error and never to success. Can anyone diagnose this issue for me?</p>