3 <script type=
"text/javascript">
5 var domainparts = document.domain.split(".");
6 document.domain = domainparts[domainparts.length-
2]+"."+domainparts[domainparts.length-
1];
7 parent.Meteor.register(this);
16 function newXmlHttp() {
17 try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
18 try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
19 try { return new XMLHttpRequest(); } catch(e) {}
23 function startstream() {
24 streamreq = newXmlHttp();
27 var url = parent.Meteor.getSubsUrl();
28 streamreq.open("GET", url, true);
29 streamreq.onreadystatechange = function() {
30 if (typeof streamreq == "undefined") return;
31 if (streamreq.readyState ==
3) {
32 extractEvents(streamreq.responseText);
33 } else if (streamreq.readyState ==
4) {
34 extractEvents(streamreq.responseText);
36 if (typeof(r)=="function") {
44 function extractEvents(responsestr) {
45 newdata += responsestr.substring(byteoffset);
46 byteoffset = responsestr.length;
48 var x = newdata.indexOf("
<s"+"cript
>");
50 y = newdata.indexOf("</
"+"script
>", x);
52 eval(newdata.substring((x+8),y));
53 newdata = newdata.substring(y+9);
56 // Last message is incomplete. Ignore it and it will be processed next time