Skip to content Skip to sidebar Skip to footer

JQuery Load() Code Not Working In Google Chrome

i am stuck here with a little jQuery Problem! I am using this code to load the content of a html file (bio.html) into a div containter (content). This works in IE8 and Firefox 6, b

Solution 1:

The issue is just that .load() for local files is blocked by Chrome for security reasons. If you are using it on a server it works, given that all of the files originate from the same place.



To enable a working version locally, start Chrome with a command line flag enabled by trying:

In Mac OS X, quit Chrome, enter in Terminal:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files

In Windows, quit Chrome, enter in Command Prompt:

chrome.exe --allow-file-access-from-files

(Maybe you actually have to have the path... I don't think so. If so, you'll have to find it yourself.)

In Linux, quit Chrome, enter something like this into the terminal:

/usr/bin/google-chrome --allow-file-access-from-files

Solution 2:

It works fine for me in chrome

http://sandbox.phpcode.eu/g/512ef/2

try to look at developer's inspect tool if you see any unexpected errors. Be sure you're in http:// or https:// protocol, file:// will not work


Solution 3:

.load() will not work in Chrome if you are loading files from your local system.

Putting it on a server will resolve the issue.


Solution 4:

Sounds like you are running this locally, is that correct? Chrome has some security features that prevent JQuery's load method to fail when run from a local harddrive. Try putting it on a server somewhere.


Post a Comment for "JQuery Load() Code Not Working In Google Chrome"