Calling web service with parameters using JavaScript/ jQuery
<p>I have a local web service that is:
<a href="http://localhost:8088/api/DuplicateCleaner/table" rel="nofollow">http://localhost:8088/api/DuplicateCleaner/table</a></p>

<p>The service works fine when called from a browser, the returned value is a string for example: <strong>table</strong></p>

<p>I am coding a simple HTML page to call it, my first attempt was using jQuery <strong>$.getJSON</strong>, which failed with this error:
<strong>Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.</strong></p>

<p>When I researched this error, I came across a solution by using <strong>jsonp</strong> which unfortunately returns the error <strong>things?callback=jQuery1102036_1475067308508&amp;things=table&amp;_=1475067308509:1 Uncaught ReferenceError: things is not defined</strong></p>

<p>As you see in my code, <strong>things</strong> is the parameter which will be holding the data passed to the service.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;script src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type="text/javascript"&gt;
    function jsonCallback(_json){
        console.log(_json);
    }

    $.ajax({
        url: "http://localhost:8088/api/DuplicateCleaner/things",
        data: {
            'things': "table"
        },
        dataType: "jsonp"
    });
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I am just looking to use the service from a simple HTML page!</p>