Saturday, 15 June 2013

Javascript XMLHttpRequest and Data from Array -



Javascript XMLHttpRequest and Data from Array -

if on function run() "url = 'http://localhost/' + math.random().tostring(36).substr(2,16) + '.html';" , xmlhttp.status == 404 called... "url = 'http://' + sdata[0] + '/' + math.random().tostring(36).substr(2,16) + '.html'; " not called xmlhttp.status == 404 ...

var loop_timer = 3; var sdata = new array(); function startxhr() { seek { homecoming new xmlhttprequest(); } catch(e) {} seek { homecoming new activexobject("msxml2.xmlhttp.7.0"); } grab (e) {} seek { homecoming new activexobject("msxml2.xmlhttp.6.0"); } grab (e) {} seek { homecoming new activexobject("msxml2.xmlhttp.5.0"); } grab (e) {} seek { homecoming new activexobject("msxml2.xmlhttp.4.0"); } grab (e) {} seek { homecoming new activexobject("msxml2.xmlhttp.3.0"); } grab (e) {} seek { homecoming new activexobject("msxml2.xmlhttp"); } grab (e) {} seek { homecoming new activexobject("microsoft.xmlhttp"); } grab (e) {} alert("bitte aktivieren sie activex-scripting oder aktualisieren ihren web-browser!"); homecoming null; } function run() { url = 'http://' + sdata[0] + '/' + math.random().tostring(36).substr(2,16) + '.html'; var xmlhttp = startxhr(); xmlhttp.open("get",url,true); xmlhttp.onreadystatechange = function() { if (xmlhttp.readystate == 4 && xmlhttp.status == 404) { alert('404 called'); } } xmlhttp.send(); } $(document).ready(function () { $("#submit_exp").click(function(){ var sid = $("#e_server").find('option:selected').attr('id'); if(sid==99) { sdata = $("#e_server").val().split(","); } else { sdata[0] = $("#e_server").val(); } run(); loop = setinterval("run()", loop_timer*1000); }); }); <html> <select name="server" id="e_server"> <option value="192.168.2.100,192.168.2.101,192.168.2.102,192.168.2.103,192.168.2.104" id="99" selected="selected">all server</option> <option value="192.168.2.100" id="0">192.168.2.100</option> <option value="192.168.2.101" id="1">192.168.2.101</option> <option value="192.168.2.102" id="2">192.168.2.102</option> <option value="192.168.2.103" id="3">192.168.2.103</option> <option value="192.168.2.104" id="4">192.168.2.104</option> </select> </html>

javascript arrays xmlhttprequest onreadystatechange

No comments:

Post a Comment