title: Cross-Domain issues on mobile Safari on iPhone, iPod & iPad
body: <p>I have a chat built with node. This chat is running on port 3000 of example.com. I am using this chat within the page of the same domain by calling it with jQuery's ajax call. So I have chat running on example.com:3000 and website that is including this chat running on example.com:80. Because different ports (even on the same domain) are already violation of the same-origin policy, I included in my node server headers "Access-Control-Allow-Origin" : "*" to allow cross calls to my chat. </p>
  
  <p>Because ajax loaded chat was looking for it's js/css files on example.com:80 I had to set paths to my js/css files on example.com:3000 to absolute paths. So chat is looking for it's js/css files with "http://example.com:3000/css/style.css" and "http://example.com:3000/js/client.js". This is working all well using regular browsers (Safari, Firefox, Chrome, etc.) for both, chat at it's own example.com:3000 and included within the example.com:80. </p>
  
  <p>However, and this is the issue, it doesn't work on any mobile Safari (iPhone,iPod,Ipad). Main page of chat will load just fine with ajax call, but the subsequent js/css files are not loaded. I can't use relative paths as client.js  and style.css files are sitting on example.com:3000 which is cross-domain.</p>
  
  <p>Is there any other place I need to place "Access-Control-Allow-Origin" setting? Or is there anything I need to do about paths? Or is there some setup within jQuery I need to do to make this work? I am out of ideas as there are no debugging tools on mobile Safari other than reporting errors. Which I am getting none. </p>