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

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.41 KB  |  hits: 20  |  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. Access-Control-Allow-Origin error in a chrome extension
  2. var xhr = new XMLHttpRequest();
  3. xhr.onreadystatechange = function(data)...
  4. xhr.open('GET', url, true);
  5. xhr.send();
  6.        
  7. DOMContentLoaded
  8.        
  9. load
  10.        
  11. onload
  12.        
  13. header('Access-Control-Allow-Origin: http://blah.com');
  14. header('Access-Control-Allow-Credentials: true' );
  15. header('Access-Control-Allow-Headers: Content-Type, Content-Disposition, attachment');