0

I want to call the other Domain Webservice(https://web.bet9ja.com/Controls/MarketWS.asmx/getClientActiveLive)

in my web page that is not working my code is given below,

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
    $(function () {
        alert("inside");
        $("[id*=btnSubmit]").click(function () {
            var name = '75';
            var age = '2';
            alert(name + " - " + age);
            $.ajax({
                type: "POST",
                url: "https://web.bet9ja.com/Controls/MarketWS.asmx/getClientActiveLive",
                data: "{ 'IDBookmaker': 75, 'IDLingua': 2, 'PartialResults': false}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (r) {
                    if (r.d.length>0) {
                        alert("something available");
                    }
                    alert(r.d);
                },
                error: function (r) {
                    alert(r.responseText);
                },
                failure: function (r) {
                    alert(r.responseText);
                }
            });
            return false;
        });
    });
</script>

kindly give the solution..

Aamec Aamec
  • 1
  • 1
  • 9
  • CORS mean what?plse explain ...how we call if not CORS excist... – Aamec Aamec Jul 11 '16 at 13:44
  • If you [check the console](https://jsfiddle.net/RoryMcCrossan/m3yLpgye/1/) you'll see this error: `No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://fiddle.jshell.net' is therefore not allowed access. The response had HTTP status code 501.` Therefore I'm closing this as a duplicate. See the linked question for a description of the problem. – Rory McCrossan Jul 11 '16 at 13:46

0 Answers0