Posts

Showing posts with the label cross

sessionStorage cross domain

This is just a quick post about my last HTML5 sessionStorage implementation for "every" browser and this is the summary: Linear Storage Protocol finally consistent as a stand alone general purpose storage (string, file, request) RC4 Stream Cipher key generation without breaking characters (\x00 not in the random range) Cross Domain Support , if both site a.com and site b.com support my implementation, they will not delete or modify each other domain information optimized boot strap for frames and iframes, the storage parsing and reassignment is performed once and not every time which means zero delay when an iframe is injected or more frames uses the same implementation Finally, few bug fixes and this version is both W3C Draft compatible and cross browser. Known Supported Browsers Chrome 1 and 2, version 3 or 4 should have native support for Web Storage Internet Explorer 5, 6, and 7, 8 has native support for Web Storage Opera 7, 8, 9, and 10 beta, hopefully 1...

Ajax or JavaScript sub domain request

Some time we could have a situation like this one: a site in a sub domain, called http://a.test.com another site in another sub domain, called http://b.test.com of course, a generic main site, called http://test.com A common problem between one or more sub domains, is the possibility to use, or call, scripts in the main domain, because of security restrictions. The simplest solution is to force, in the client side, the document.domain, specifying the common one, i.e. dcument.domain = "test.com"; In this way you can add, for example, an iframe, and read its content, or use parent window object from the iframe that points, for example, to http://test.com There are different reasons to do it, and one of them, is the ability to share a global, or common, space, between every sub domain, performing Ajax requests or whatever else we need. This object, saved in http://test.com, and loaded by every other sub domain, like "a" or "b", could solve in a really simple ...