Passing JS variable from child Iframe to parent JSP on cross sub domain
- by Tarun
I am stuck at 1 location and need some help. I created two subdomains on apache tomcat server like domain1.localhost.com and domain2.localhost.com in server.xml. On domain1 I have a JSP that includes iFrame (hosted on domain2). How can we pass the JS variable from child Iframe to parent JSP and store it in local variable of JSP hosted on domain1.localhost.com?
I tried defining document.domain = "localhost" on both JSP but didn't work. Even parent DOM window is also not available in child iFrame (on sub-domain) because of obvious cross domain policies.
Any help would be highly appreciated.