Because iPad/iPhone doesn't support cookies from third party sites, I want to store values in localStorage. An example on domainA might be:
<script src="http://domainB/something.js"></script>
this script on domainB can access window.localStorage and it works great. However the values are stored in domainA because that's the document's location.
If I put my script inside an iframe whose source is on domainB, then it works, but I'm trying to avoid frames. So my question is: Is there a way to get/set values in localStorage on a remote domain such that they'll be there when I visit domainB at a later time?
This isn't possible without your iframe workaround.
The ability to access the same localStorage object from multiple domains would violate the Same origin policy,and the spec:
http://dev.w3.org/html5/webstorage/#security-localStorage
If this wasn't for iPhone, I would suggest a flash solution. But with localStorage, I think you are out of luck until they implement a cross-domain policy.