Couple things
First you have an in your javascript code. It is missing a ")" after your curly braces on your last line.
Secondly, I assume you are also including the jquery library, as this is jquery code, otherwise it won't run if you don't include/src it.
I ran your code with the included jquery library and adding the missing ) and it seemed to run OK, but it would not connect to your script page as I received a permission denied error on your gateway page.
Code:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var home_add = 'http://myweb.net:3300/gateway';
$('#handshake').click(function () {
alert(" sending json data");
$.ajax({
/* start ajax function to send data */
url: home_add,
type: 'POST',
datatype: 'json',
contanttype: 'text/json',
async: false,
error: function () {
alert("handshake didn't go through")
},
/* call disconnect function */
data: {
"supportedConnectionTypes": "long-polling",
"channel": "/meta/handshake",
"version": "1:0" },
success: function (data) {
$("p").append(data + "<br/>");
alert("successful handshake")
}
});
});
})
</script>