1

i'm using thickbox in my webpage

it's working well in firfox , ie but not working in google chrome it shows error

XMLHttpRequest cannot load file:///W:/www/pennyauction/home_page/site/flyout.html?height=315&width=185&inlineId=myOnPageContent&random=1296046181308. Origin null is not allowed by Access-Control-Allow-Origin.

Any idea about this.

Thanks in advance

1 Answer 1

1

Chrome has a design policy that forbids you from using XMLHTTPRequest to load local files. Firefox does not have this policy.

Presumably you are developing on your local machine for testing purposes and will upload your files to a real server later.

The best solution for testing is to run a lightweight HTTP server on your local machine. A slightly hacky workaround is to open Chrome with the command chrome --allow-file-access-from-files, which allows you to do local AJAX temporarily.

3
  • thanks for answer. how to fix this issue, what is this mean "chrome --allow-file-access-from-files"
    – Gowri
    Jan 26, 2011 at 13:13
  • @gowri Start Chrome using that command. If you are on Windows, just type it into the search box in the Start menu and press return. Jan 26, 2011 at 13:17
  • @gowri Possibly not. I agree that on my Linux installation with Chromium, I get the same error. Possibly this option has been disabled. My advice would be to install a lightweight server, e.g. WAMP. Jan 26, 2011 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.