Hey is it possible to get the socketid inside of an Dashboard template node via javascript?
I want to get the id for a multiuser environment to display user specific content with a XMLHttpRequest inside of template node.
I tried with window.location.search or getting it from from the url parms without luck
Thanks
<script>
function httpGet(theUrl)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("test-socketid").innerHTML = xmlhttp.responseText;
return xmlhttp.responseText+"test";
}
}
xmlhttp.open("GET", theUrl, false );
xmlhttp.send();
}
var delayInMilliseconds = 2000;
setTimeout(function() {
httpGet("/socket/control/name?socketid="+window.location.search);
send({payload:window.location.search});
}, delayInMilliseconds);
</script>
<div id="test-socketid" ></div>