I have a qooxdoo project that fetches JSON from an online server using the following codes:
var url = "http://www.example.com/json.php?q=parameter_here";
var store = new qx.data.store.Json(url,"GET", "text/plain");
store.addListener("changeModel", function(ev) {
console.log("changeModel()");
console.log("getData", ev.getData());
});
store.addListener("error", function(ev) {
console.log("error", ev.getData());
});
store.addListener("changeState", function(ev) {
console.log("state", ev.getData());
});
I'm using iMac, and the local path is /Users/SomeUser/Path/To/index.html
I tried to load the index.html
in Chrome browser as usual, but failed, as Chrome blocks the Javascript as Origin null is not allowed by Access-Control-Allow-Origin
. After I read the answer from this question, I know I have to host it in a web server. Therefore I set up a XAMPP for this site.
Since my XAMPP has few existing Alias, I add a new Alias for this site, as follow:
<Directory "/Users/SomeUser/Path/To">
Options All
AllowOverride All
Require local
Order allow,deny
Allow from all
</Directory>
Alias /myalias "/Users/SomeUser/Path/To"
When I set up the Alias like this, 403 Forbidden is reported. Then, I found this question on SO, but the answers didn't help. Still 403 Forbidden.
My goal is to load the site in local XAMPP server. What did I miss? When I upload the folder to a web server online, it works fine.
In XAMPP Apache error_log
, it shows:
[Fri Apr 19 17:51:09 2013] [error] [client 127.0.0.1] (13)Permission denied: access to /myalias/index.html denied
For the file, its permission is:
drwxr-xrwx 7 SomeUser staff 238 Apr 2 16:48 .
Note: I don't want to change the Chrome launch options to override the Access-Control-Allow-Origin
policy.