i have following code , want data service. have set google.
function checklicense() { debugger try { var _name = "aaa-bcs-edt"; //location.host; $.ajax({ type: "post", url: "http://mdc.abc.com/licensewebservice.svc/islicensevalidbyname", data: '{"dname":"' + _name + '"}', contenttype: "application/json; charset=utf-8", crossdomain: true, datatype: "json", async: false, success: function (msg) { debugger var data = msg.d; if (data == "success") { licenseactivated = "success"; } else { licenseactivated = "fail"; } }, error: function (xmlhttprequest, textstatus, errorthrown) { debugger alert(errorthrown.tostring()); } }); } catch (err) { debugger alert(err.message.tostring); }
head:
<head> <title>create purchase order</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta> <meta> <meta> </head>
can please suggest me?
you need enable cors headers in server side.
http://www.codeproject.com/articles/845474/enabling-cors-in-wcf
Comments
Post a Comment