uest,request_functn) { if (http_request.readyState == 4) { if (http_request.status == 200) { request_functn(http_request);//.responseText); } else { alert(' '); } } ////////////////////////////////////////// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> <title> jquery</title> <script type="text/javascript"> function createRequest () { var request = null; try { request = new XMLHttpRequest (); } catch (e) { try { request = new ActiveXObject ("Microsoft.XMLHTTP"); } catch (e) {} } return request; } function getFile (name) { var req = createRequest (); req.open('GET', name, false); // req.overrideMimeType('text/plain; charset=windows-1251'); req.send(null); document.getElementById ('mytext').firstChild.data = req.responseText; } </script> </head> <body onload="getFile('text.txt')"> </body> <div id="mytext"></div> </html> //////////////////////////// <script> $(document).ready(function(){ $('#txtfile').load('http://mysite/myfile.txt'); }); <script> <div id="txtfile"></div> /////////////////////////// PHP + CSS : <!-- --> <style type="text/css"> .textblock { /* , */ color: red; } </style> <?php // $filename='text.txt'; // $file=file_get_contents($filename); // + echo '<div class="textblock">'.$file.'</div>'; ?> ///////////////////////////// : HTML : <?php $file='myfile.txt'; include($file); ?> /////////////////////////////// <?php @print file_get_contents('myfile.txt') ?> /////////////////////////////// <div id="some_id"> <?php echo file_get_contents('myfile.txt') ?> </div> ///////////////////////////// php, : <?php $textfile = "http:// / .txt"; // if ($quotes = @file("$textfile")) {$quote = rand(0, sizeof($quotes)-1); echo $quotes[$quote]; // }else{echo (" ");} // , ?> , , , . ////////////////////////////////////// $s = ''; $r = explode( "\n", file_get_contents( '__' ) ); $s .= "<table>"; for( $i = 0; $i < count( $r ); $i++ ) { $s .= "<tr>"; $s .= "<td>" . join( '</td><td>', explode( ":", $r***91;$i***93; ) ) . "</td>"; $s .= "</tr>"; } $s .= "</table>"; echo $s; ////////
назад далее
перейти
в начало
В библиотеку

на главную



..
(c) xika.ru