Krenair

spray.tf2.azelphur.com view images from list

Aug 8th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var script = document.createElement( 'script' );
  2. script.setAttribute( 'src', 'http://code.jquery.com/jquery-2.0.3.min.js' );
  3. script.setAttribute( 'type', 'text/javascript' );
  4. document.head.appendChild( script );
  5.  
  6. var time = ( new Date ).getTime();
  7. var httpErrorHandler = function ( e ) {
  8.     var element = e.target;
  9.     var sprayFileName = $( element ).parent().find( 'a.contentno' ).attr( 'href' );
  10.     $( document.body ).append( $( '<iframe>' ).attr( {'visibility': 'none', 'src': sprayFileName} ) );
  11.     $( element ).attr( 'src', $( element ).attr( 'src' ) + '?' + time );
  12. };
  13. $( 'li.contentn' ).css( {'border': '1px solid black', 'list-style-position': 'inside'} );
  14. $( 'li.contentn' ).each( function ( index, element ) {
  15.     var sprayFileName = $( element ).find( 'a.contentno' ).attr( 'href' ).match( /spray=(.*)&/ )[1];
  16.     $( element ).prepend( $( '<img>' ).attr( 'src', 'http://spray.tf2.azelphur.com/sprays/' + sprayFileName + '.vtf.gif' ).error( httpErrorHandler ) );
  17. } );
Advertisement
Add Comment
Please, Sign In to add comment