Most browsers adhere to the “same-origin” policy, which prevents AJAX calls between different servers identified by their host name as a security measure.
There have been a number of approaches used to solve this problem and here is a brief list of them.
From the client side, depending on the browser, you can lower browser security settings to allow for cross site / cross domain ajax.
If the two sites are sub domains on the same domain, use document.domain to make them use the same super domain.
All the above solutions have different requirements that bring about various other problems. Hence I had to come up with another approach for a project based on ideas from a discussion with a couple of colleagues.
This approach would ideally:
The following diagram illustrates how this approach works with iframes to manage call backs to an iframe.
Today for work I investigated the implementation of South Korean maps for one of our clients, unfortunately Google Maps doesn’t currently have street level details and view in South Korea. I ended up having to look at maps.naver.com which seems to be the only decent free korean mapping site available on the Internet with an API as well. Unfortunately for me, I did not understand korean, google translate was unable to help me with the site and there was no english translation available. After scanning through the API (in Korean), I managed to make out how implement the code but it was impossible to register without understanding the 10 step registration process in order to get an API key to use the maps . . . anyway here’s how I got it working without the API key!
One of the biggest grief in web development is fixing these minor quirks between Internet Explorer and Mozilla based browsers like Firefox. Microsoft then makes it more difficult with more quirks between IE5, IE6 and IE7. To give Microsoft some credit, they seem to have genuinely tried to make IE7 more standards compliant than its predecessors. Just yesterday, Conditional Comments placed in my code for adding addition JavaScript code to fix IE quirks gave me some grief. Let me explain further…
<< Previous ::