Advertisement
Guest User

Untitled

a guest
Dec 12th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. // JAVASCRIPT
  2. setInterval(function()
  3. {
  4. $('div').each(function()
  5. {
  6. $.get( 'ajax.php' , function( data )
  7. {
  8. // quando response for igual a 10, não houve erro
  9. // quando for maior, vai disparar um alerta com o erro do php para você ver
  10. if( response.length > 10 )
  11. {
  12. alert( 'falhou' )
  13. $('html').html( response )
  14. }
  15. });
  16. })
  17. } , 100 )
  18.  
  19.  
  20. // ajax.php
  21. $fp = fopen( 'file.txt' , 'w' );
  22. fwrite( $fp , 'texto' );
  23. fclose( $fp );
  24. echo 'escreveu';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement