Monday, October 27, 2014

Access data across domains


When working with jQuery and JavaScript, there was a need to access a "Remote Web Service" which was hosted from a different server.

Since I was debugging using my local laptop, the application was throwing errors like "Cross-domain policy file missing" or "Unable to access data across domains".

After some research, I found that we can make both Internet Explorer and Chrome browser work with data from different domains.

In Internet Explorer do this.

Under Security Tab, click "Custom Level" button. Scroll Down to Miscellaneous Section and choose "Access data sources across domains" - Enable.

In Chrome do this.

Create a simple short-cut on Desktop. Add the following line as the "Start up Application" for the short-cut.

"C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe" --allow-file-access-from-files --disable-web-security

This will open the Chrome Browser in a different mode capable of accessing data across domains.

Hope this tip helps.

Happy Coding !
 

No comments:

Post a Comment

All Blogs so far ...