Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.41 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Check if user is blocking 3rd party domain
  2. $.ajax 'http://aws.amazon.com/s3/',
  3.   type: 'GET',
  4.   dataType: 'html'
  5.   complete: (e, xhr, settings) ->
  6.     if e.status == 200
  7.       console.log "Not Blocking S3"
  8.     else
  9.       console.log "Blocking S3"
  10.        
  11. <img id="checkImg" src="https://www.google.com/images/srpr/logo3w.pngAAA" />
  12.        
  13. if(document.getElementById('checkImg').clientWidth != 275)
  14.     alert("Error")