Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javascript to detect chrome url from iframe  RSS feed

 
yudi raj
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having an application in an iframe and I am calling this from a different domain. For example, my browser url is a.com and my iframe url is b.com (different domain). I am loading this iframe (b.com) in a.com thus making their domains different.
I tried with the below function in js, this works in IE and Mozilla, however, with Google chrome, my js is not able to reach the browser url.
Would appreciate if anyone can give me some direction on this

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same origin policy keeps a from talking to b.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!