Hi all,
Do we allow $ Subject?
I tried the below snippet in a file called index.jag. But it breaks
silently.
<!DOCTYPE html>
<%
var log = new Log();
WebSocket.ontext = function (data) {
log.info('data sent '+ data)
};
%>
<html>
<head>
<meta charset="UTF-8">
<title>Jaggery WebSocket</title>
<script type="text/javascript">
var ws = new WebSocket(
"ws://localhost:9763/web/index.jag");
function sendMessage() {
ws.send(messageText.value);
messageText.value = "";
}
</script>
</head>
<body>
<div>
<br>
<input type="text" id="messageText" size="50" />
<input id="button1" type="button" value="Send" onclick="sendMessage();">
</div>
</body>
</html>
But if I move the below snippet to a different file called server.jag and
change the web socket url to ws://localhost:9763/web/server.jag, it works
fine.
<%
var log = new Log();
webSocket.ontext = function (data) {
log.info('data sent '+ data)
};
%>
I understand it doesn't make sense to call the same page. But just asking :)
Thanks,
Tanya
--
Tanya Madurapperuma
Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94718184439
Blog : http://tanyamadurapperuma.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev