If you do any front-end development locally (and test in Google Chrome) you may have run into a problem using the .load() function or other AJAX requests. The functions are just unable to return any data, It boils down to a permissions issue with Chrome pointing to local files.
You can resolve this by uploading your files to a live production server, but that is a pain, especially if you’re still in development.
There’s a very simple solution:
1. Close Chrome completely
2. Launch Chrome from Terminal with the “–allow-file-access-from-files” argument
open /Applications/Google\ Chrome.app --args --allow-file-access-from-files
This will allow that session of Chrome to access local files. Note: Once you close and reopen the application you’ll no longer have access to local files again.
Hey Rob, thanks for sharing the solution! I had just spent about 15 minutes being really confused as to why .load wasn’t working.
Hello Rob. Thanks a lot for your help. I found this link through stackoverflow [1] and finally could solve this problem. I’m just learning jQuery and was going crazy with this. Also English is not my native language and is very hard to find certain answers.
Again: Thanks!!
[1]: http://stackoverflow.com/questions/5616618/jquery-and-browser-compatibility