1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Nouvelle page 1</title>
<script type="text/javascript">
function myAjax(format){
var recup=self.parent.foo.document.body.innerHTML.replace(/^(<pre>)?(([^<](?!\/pre))*)(<\/pre>)?$/i,'$2')
var temp
switch(format){
case ('json') : temp= eval('('+recup+')');
break;
case('txt') : temp= recup;
break;
case('sep'): temp=recup.split(arguments[1])
default : temp= recup;
}
return temp;
}
</script>
</head>
<body onload="truc=myAjax('sep','\r\n');alert(truc)">
<iframe name='foo' id="foo" src="test.txt" width="300" height="500" style="display:none">
</iframe>
</body>
</html> |
Partager