title: How do i get data from a Labview web service restful with ajax or JSON?
body: <p>I am trying to to use <code>ajax</code> and/or <code>JSON</code> for Web service restful which I have build and deployed with the Labview software.</p>
  
  <p>However I get errors (parserror)
  For example. I have build a web service from a Labview vi (<code>z =x/y</code>    <code>localhost:8080/math/divide/5/20</code> will give <code>{Z:"4.000000"}</code> ) </p>
  
  <p>I get results when I run the web service with the browers (Chrome, Explorer or from Android application I have wrote) but I am getting errors for the below examples.</p>
  
  <p>Below are 2 examples: <code>ajax</code> and <code>getJSON</code></p>
  
  <p>Does anyone know how to get data from the labview web service with <code>ajax</code> or <code>json</code>?
  Thanks...Eran</p>
  
  <ul>
  <li><p>Example 1</p>
  
  <pre><code>var url = "localhost:8080/math/math/5/20";
  $.ajax({
      dataType: "jsonp",
      ContentType: "application/json",
      headers: {
          "Access-Control-Allow-Origin": "*",
          "Access-Control-Allow-Methods": "GET"
      },
      url: url + '&amp;callback=?',
  }).done(function (data,status) {
     alert(status);
  }).fail(function (data,status) {
     alert(status);
  });
  </code></pre></li>
  <li><p>Example 2</p>
  
  <pre><code> $.getJSON("localhost:8080/math/divide/5/20&amp;callback=?", function (data) {   
  
   }).done(function (data,status) {
         alert(status);
   }).fail (function (data,status) {
        alert(status);
   });
  </code></pre></li>
  </ul>