こんにちは、私のAndroidアプリで、jqueryでwebsocketを使用しています
このスクリプトを使用して websocket に接続しようとしています
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery.mobile-1.0a2.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script src="cordova-1.8.0.js"></script>
これは、websocket に接続するために使用したコードです
var ITOUCH_WEBSOCKET = {"remote_address":'ws://atwerervgt',"channel":'alert'};
(function pulse(websocketDetails){
if ("WebSocket" in window)
{
alert("Websocket is supported");
// Let us open a web socket
var ws = new WebSocket(websocketDetails.remote_address,websocketDetails.channel);
ws.onmessage = function (evt)
{
}
createAlert(received_msg,received_msg.actionType==='NEW');
} else {
// alert("Message Received : Action Type is " + received_msg.actionType);
}
};
ws.onclose = function()
{
// websocket is closed.
//alert("Connection is closed...");
// On close reconnect again
pulse(websocketDetails);
};
}
else
{alert("Websocket is not supported");
}
})(ITOUCH_WEBSOCKET);
});
私が受け取っているアラートは Websocket is not supported です
私のwebsocketコーディングの問題は何ですか?