日期:2014-05-16 浏览次数:20379 次
<script type="text/javascript">
window.onload = function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","url.txt",false);
xmlhttp.send();
document.getElementById("box").innerHTML=xmlhttp.responseText.replace(/.+/g,function(url){
return url
})
}
</script>
<script type="text/javascript">
window.onload = function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","3.txt",false);
xmlhttp.send();
var $r = /.+/g;
var $a = xmlhttp.responseText.match($r);
document.getElementById("box").innerHTML=$a[2]; //第3行;
}
</script>