John Doe
John Doe

Reputation: 3691

How can I pass a value to a javascript function on the parent page?

How could I pass a value to a function on a parent page?

Would it be something similar to this?

parent.functionname("VALUE")

Upvotes: 1

Views: 114

Answers (1)

SLaks
SLaks

Reputation: 888283

Yes.

As long as both pages are in the same domain, you can access the global scope (window object) of the parent frame using the frame's parent object.

You can use any global data (functions or variables) by writing parent.whatever.

Upvotes: 2

Related Questions