Search code examples
javascriptjqueryajaxgoogle-chromexmlhttprequest

Chrome: XMLHttpRequest cannot load, cross-origin request error


I know this is a bug in Chrome, and that this works in every other browser.

Here is the simple code throwing the error:

$(function() {
    $('#content').load('home.html' + '#container').hide().fadeIn('slow');
});

My question is, is this only a local host error, will the still happen in chrome if the website is on a server?


Solution

  • I think that it is only for localhost in server works fine.

    Try this extension of crhome: Allow-Control-Allow-Origin: *