I have a basic ajax request that retrieves a menu and puts it on a web page.
Here is the code
//display the menu
$.post(server+"quizz/phpScripts/retrieveMenu.php", {}, function(data){
$("nav, #lowerMenu").html(data);
});
In my original files, 'server' was 'localhost', but when I hosted the site and tried to open the page, I get this error in the console.
Using firefox
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://edwaze.com/quizz/phpScripts/retrieveMenu.php. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
Using Safari
XMLHttpRequest cannot load https://edwaze.com/quizz/phpScripts/retrieveMenu.php. Origin http://www.edwaze.com is not allowed by Access-Control-Allow-Origin.
Using Chrome
XMLHttpRequest cannot load https://edwaze.com/quizz/phpScripts/retrieveMenu.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://edwaze.com' is therefore not allowed access.
I've read quite a bit on this, but I haven't found a solution yet. Please help. And go easy with the terminologies please, i'm a bit new to ajax :)
Thanks.