Ajax Code :
function init(evt) { svgdoc=evt.target.ownerDocument; try { req = new ActiveXObject("Microsoft.XMLHTTP"); // try Internet Explorer } catch(e) { req = new XMLHttpRequest() // firefox } req.open("POST", "init", true); // ASYNC Request); // Query the server and update the SVG with any changes using setAttribute req.onreadystatechange = function() { if (req.readyState == 4 && req.responseText) { eval(req.responseText); } } req.send(null); queryServerPooling(evt); } // Send every 100 ms a message to the server function queryServerPooling(evt) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); // try Internet Explorer } catch(e) { req = new XMLHttpRequest() // firefox } req.open("POST", "init", true); // ASYNC Request); // Query the server and update the SVG with any changes using setAttribute req.onreadystatechange = function() { if (req.readyState == 4 && req.responseText) { eval(req.responseText); } } req.send(null); setTimeout(queryServerPooling, 100) } |
Maintained by Julien Gardette. | Last Modified: 2008/09/10 00:03:05. |