0

var metaTags = window.parent.document.getElementsByTagName("meta"); console.log("hello"+metaTags.length);

My script is running in an iframe and I am not able to access the parent documents meta tags.The funning thing is nothing is getting printed on console.Not even Hellonull or something.

Thanks in advance Swaraj

Swaraj Chhatre
  • 627
  • 1
  • 10
  • 22

1 Answers1

1

I am pretty sure you cannot execute cross frames/domains. If the domains match, you can do this, but if not, then it is a security issue that blocks it. Here is an example of doing so when the domains are the same: Getting parents document from iFrame

Community
  • 1
  • 1
Casey ScriptFu Pharr
  • 1,672
  • 1
  • 16
  • 36