I have a javascript function to validate user's input in input or textarea field, I also want to apply these functions on the Iframe's textarea. Is it possible to run the parent's javascript on an iframe with another domain. If yes, how can I do it. Sorry for my newbie question. Thanks in advance
-
is your iframe on the same domain?Vicky Gonsalves– Vicky Gonsalves2013年10月23日 07:13:30 +00:00Commented Oct 23, 2013 at 7:13
-
post some code so that we can checkVicky Gonsalves– Vicky Gonsalves2013年10月23日 07:13:49 +00:00Commented Oct 23, 2013 at 7:13
-
developer.mozilla.org/en-US/docs/Web/JavaScript/…Abhitalks– Abhitalks2013年10月23日 07:15:02 +00:00Commented Oct 23, 2013 at 7:15
-
possible duplicate of <iframe> javascript access parent DOM across domains?raam86– raam862013年10月23日 07:18:00 +00:00Commented Oct 23, 2013 at 7:18
-
abhitalks has already posted a link explaining the Same-Origin Policy. In some situations there are some work-arounds though.Teemu– Teemu2013年10月23日 07:18:01 +00:00Commented Oct 23, 2013 at 7:18
2 Answers 2
You can't do this as a result of the Same Origin Policy http://en.wikipedia.org/wiki/Same_origin_policy
Sign up to request clarification or add additional context in comments.
Comments
Unfortunately if the source of the iframe is on a different domain you won't be able to interact with the content.
answered Oct 23, 2013 at 7:17
Corey Rothwell
3942 silver badges9 bronze badges
Comments
lang-js