<html> <div id="A"></div> </html> <script type="text/javascript"> var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","http://en.wiktionary.org/wiki/Wiktionary:Word_of_the_day/Archive",true); xmlhttp.send(); xmlhttp.onload = writetodoc; function writetodoc() { //var string = (new XMLSerializer()).serializeToString(xmlhttp.responseXML.getElementsById("WOTD-rss-title")); var res = xmlhttp.responseXML;//getElementById("WOTD-rss-title"); var string = (new XMLSerializer()).serializeToString(res); //document.getElementsById("A").innerHTML=string; alert(string); } </script>
<html> <div id="A"></div> </html> <script type="text/javascript"> var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","http://en.wiktionary.org/wiki/Wiktionary:Word_of_the_day/Archive",true); xmlhttp.send(); xmlhttp.onload = writetodoc; function writetodoc() { //var string = (new XMLSerializer()).serializeToString(xmlhttp.responseXML.getElementsById("WOTD-rss-title")); var res = xmlhttp.responseXML;//getElementById("WOTD-rss-title"); var string = (new XMLSerializer()).serializeToString(res); //document.getElementsById("A").innerHTML=string; alert(string); } </script>
|