我有一个从移动平台调用的 wcf 服务。当我从移动设备中的浏览器调用 wcf 时,它可以工作。然后我将我的 html 转换为使用手机的应用程序。但这一次,我无法调用 wcf 服务。有任何想法吗?这是我的html;
<title>Mobilizm</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/Mobilizm.css" rel="stylesheet" />
<link href="css/jquery.mobile.structure-1.3.2.min.css" rel="stylesheet" />
<script src="js/JSON.js"></script>
<script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.3.2.js"></script>
<script>
$(document).on("pageinit", function (event) {
$('#save').click(function () {
debugger;
var typesArray = new Array();
var myType = new Object();
myType.FirstName = $("#name").val();
myType.LastName = $("#surname").val();
myType.EMailAddress1 = $("#email").val();
myType.MobilePhone = $("#cellphone").val();
typesArray.push(myType);
$.support.cors = true;
$.getJSON("http://xxxxx/Mobile/MobilizmService.svc/CreateCustomer?callback=?", { customers: JSON.stringify(typesArray), origin: 167440003, status: 167440001 })
.done(function (json) {
alert("ok");
})
.fail(function (jqxhr, textStatus, error) {
alert("false");
});
</script>
</head>
<body>
<div data-role="page">
<div data-theme="d" data-role="header">
<h3>Yeni Kullanıcıgg</h3>
</div>
<div data-role="content">
<div data-role="fieldcontain">
<label for="name">Ad:</label>
<input type="text" name="name" id="name" value="" data-mini="true" />
</div>
<div data-role="fieldcontain">
<label for="surname">Soyadı:</label>
<input type="text" name="surname" id="surname" value="" data-mini="true" />
</div>
<div data-role="fieldcontain">
<label for="email">E-Posta:</label>
<input type="text" name="email" id="email" value="" data-mini="true" />
</div>
<div data-role="fieldcontain">
<label for="cellphone">Cep Telefonu:</label>
<input type="text" name="cellphone" id="cellphone" value="" data-mini="true" />
</div>
<input data-theme="d" type="button" value="Kaydet" id="save" />
</div>
<div data-theme="d" data-role="footer">
<h3>Yeni Kullanıcı</h3>
</div>
</div>