HTML Code:
<script type="text/javascript">
function yourfunc(url){
oxmlhttp = null;
try{ oxmlhttp = new XMLHttpRequest(); oxmlhttp.overrideMimeType("text/xml"); }
catch(e){
try{ oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
catch(e){ return null; }
}
if(!oxmlhttp) return null;
try{ oxmlhttp.open("GET",url,false); oxmlhttp.send(null); }
catch(e){ return null; }
document.getElementById('tx').value=oxmlhttp.responseText;
}
</script>
call yourFunc('resources/text/test.txt')
it writes to textarea id="tx" so you can see it as code
Bookmarks