call function from iframe to parent page

Hi,

on iframe, I did parent.myfunction();, it works when the iframe page is under the same domain.  When the page in iframe is from different domain, it does not work.  Is there a solution?  thx
mcrmgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
Hello mcrmg,

No.

Regards.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leakim971PluritechnicianCommented:
Thanks for the points!
0
mcrmgAuthor Commented:
I am sorry the question is closed.  I will reopen it if needed.

Here is what I have:
on parent page, I have a DIV that controls show/hide of the iframe

on iframe page, (this is a page from different domain but inside the same network), I have a recordset, if rs has value, iI want to show DIV, if not, hidden DIV in parent page.  Is this doable?  thx
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

leakim971PluritechnicianCommented:
No, you have no link between both of what you see iframe and you page content.
You are only able to call parent function (same domain) but the function always run in the iframe as I know.
0
mcrmgAuthor Commented:
okay, thank you
0
mcrmgAuthor Commented:
last question, is that a way to move DIV to the domain same as iframe?  (I guess not right?)
0
leakim971PluritechnicianCommented:
I'm sorry I don't understand your question
0
mcrmgAuthor Commented:
sorry about that, I want to see if there is any way that I can show/hide the DIV based on the RS result from the iframe, so, since they can only talk when they are in the same domain, is that a way to move DIV to another domain?

Currently:
Domain1
DIV
   iframe  (a page in domain2)

if result from rs is empty, I want to hide DIV.  thx
0
mcrmgAuthor Commented:
Actually, I might have a workaround (in theory), but very stupid.

I could link to the page that in iframe, then I will know if rs is empty or not, then link back to the parent, based on the querystring, I can then display DIV, then I can deceide if I need to include iframe or not based on the querystring...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JScript

From novice to tech pro — start learning today.