jquery - javascript get html file from online link -


i want call html online link using xmlhttprequest javascript, here code when code arrive xmlhttp.open stopped , not continue execution

function loadxmldoc(size,downloadfromurl) {     var xmlhttp;      if (window.xmlhttprequest) {         // code ie7+, firefox, chrome, opera, safari         xmlhttp = new xmlhttprequest();     } else {         // code ie6, ie5         xmlhttp = new activexobject("microsoft.xmlhttp");     }      xmlhttp.onreadystatechange = function () {          if (xmlhttp.readystate == 4 && xmlhttp.status == 200) {             var temp = xmlhttp.responsetext;          }     }      xmlhttp.open("get", "http://app.arsel.qa/mobileappspeedtest/samples/256.htm?n=" +  math.random(), false);      xmlhttp.send(null);  } 

what doing actual ajax request page. cross domain ajax requests not allowed default security reasons. however, there several ways of performing cross domain requests, , take @ how jquery it, don't have reinvent wheel on again using plain javascript. this article should helpful.

anyway, if want crawl page, there tons of open source libraries server side scripting languages java, php, node.js, etc useful in gathering content, parsing html , on, depending on needs.


Comments