Cross domain access for JSON interface using AJAX
Bug #816607 reported by
abdullahc
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Alfanous - Quranic Search engine |
Fix Released
|
High
|
Assem Chelli (عاصم شلي) |
Bug Description
Salam,
I'm using Chromium 12.0.742.112 (90304) Ubuntu 10.04.
Trying to access Alfanous JSON interface from JavaScript (jQuery). The browser prevents my script from retrieving data.
chromium js console:
XMLHttpRequest cannot load http://
As it is mentioned here:
http://
A workaround is to add callback= to GET parameters
Otherwise:
server reply must have 'Access-
Changed in alfanous: | |
assignee: | nobody → Assem Chelli (عاصم شلي) (assem-ch) |
importance: | Undecided → Critical |
status: | New → Incomplete |
status: | Incomplete → New |
To post a comment you must log in.
Salam ,
First ,thank you for submiting this bug. as i read it's about the browsers policy that restrict getting information from other websites.
I added this header to the service script: Control- Allow-Origin: *' Control- Allow-Methods: GET'
print "Content-Type: application/json; charset=utf-8"
#Allow cross domain XHR
print 'Access-
print 'Access-
print
Also I added this to .htaccess : Control- Allow-Origin *
Header set Access-
I hope this helps.