When developing Ajax applications on local machine you may face this error on almost all browsers that cross referring a link from other domain is not allowed. This is mentioned as the “Access-Control-Allow-Origin” on Google Chrome. To work around this issue, temporarily – yes temporarily as this may make your system unsafe – you need to run Chrome with following argument – “–disable-web-security”.
On Linux you can use the following command to sun Google Chrome with web security disabled –
On Windows machine you can create a shortcut to Google Chrome and add the above mentioned flag in the command line.
Please remember that do not use your browser for browsing non-trusted sites in this mode. Only use this for testing and development purpose only. This is for your security only.
Update: If you have access to the file server which you are accessing from a different server, then you can use “.htaccess” directive also to allow access from a domain or all domains.
Header set Access-Control-Allow-Origin "*"
Suppose you are accessing file “xyz” hosted on server “One” from server “Two” then you need to add the .htaccess directive in the directory of the server “One” to which you want to allow remote access.
To restrict the access from specific domains only you can specify the domain name(s) in place of “*” separated with comma like –
Search the site
- Uploading files to FTP server from PHP Script
- Updating Nokia E72 phone software
- Working with Access-Control-Allow-Origin
- Connecting Sony K750 with Windows 7
- MySql Dump Using a PHP Script
- Displaying UTF characters in the FPDF
- Reset password of Joomla 1.0.x Administrator
- Setting include path for a domain in Plesk
- Using AjaxHelper for pagination in CakePHP 1.3
- ~ Elance ID – App_Services
"Its a real pleasure to get to write this review.. Truth is we kept adding and adding and adding to this project and Rajendra should have gotten 3 or 4 of these reviews by now. I can say with 100% honesty that if your looking for a stress free experience then this is the provider to use. His English is great, and there are none of the "miss-communications" that are known to happen with providers outside the USA. Although there are other providers that are less per hour, I have tried them... and I have seen first hand over billing or very inefficient work. However with this provider, the work is done fast, and its done right (the first time). This provider has been the best coder I have used on Elance, bar none. Thanks Rajendra for doing such a great job, I wish you the best in"
- Read more testimonials »
What's the little bird saying?
- New post: Fix Error 0x80070424 on windows http://t.co/bmK0AZpH 2 years ago
- New post: Configuring Horder Vacation Responder in Plesk 9 http://t.co/gcsPNIVv 2 years ago
- New post: Wordpress update issue on Plesk http://t.co/dUxcjpgR 2 years ago
- I’ve just taken the WordPress 2012 User and Developer Survey, have you? http://t.co/G20SmrMr (pass it on!) 2 years ago
- New post: Mobile device emulators to test web page display http://t.co/jmgc0x99 2 years ago