Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // JAVASCRIPT
- setInterval(function()
- {
- $('div').each(function()
- {
- $.get( 'ajax.php' , function( data )
- {
- // quando response for igual a 10, não houve erro
- // quando for maior, vai disparar um alerta com o erro do php para você ver
- if( response.length > 10 )
- {
- alert( 'falhou' )
- $('html').html( response )
- }
- });
- })
- } , 100 )
- // ajax.php
- $fp = fopen( 'file.txt' , 'w' );
- fwrite( $fp , 'texto' );
- fclose( $fp );
- echo 'escreveu';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement