海我的应用程序试图与服务器通信,所以我在 ajax 中调用了 web 服务,现在我想在 ajax 中设置时间间隔。任何人都可以指导我
$(document).ready(function () {
$("#btn").attr("disabled", true);
//waitingDialog({});
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
var imei2 = '';
imei2 = device.uuid;
checkConnection_inonload(imei2);
}
function checkConnection_inonload(imei2) {
var networkState = navigator.network.connection.type;
alert(networkState);
var states = {};
states[Connection.WIFI] = 'WiFi connection';
if (states[networkState] == 'WiFi connection') {
$.ajax({
cache: false,
async: true,
type: "GET",
dataType: "json",
url: "http://xxxx/Service1.svc/GetKeepMeStatus",
data: {
IMEINO: imei2
},
contentType: "application/json;charset=utf-8",
success: function (r) {
//closeWaitingDialog();
//alert(r);
if (r == "status") {}
});