1

In a iframe div, I have several pages. whenever user scrolls within that div, I need to update the current page number in parent window (same origin).

To achieve this, I have binded a scroll event to the div element and made the calculations to get current page number in iframe. But, struck how to pass this data to parent window.

2 Answers 2

1

You can create a function in your parent page.

Parent

function parentcalc(data) { //use your data } 

And call this function in the child like this

iframe

parent.parentcalc(mydata); 
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, Alexis! I will try this.
1

You can access the parent frame through the parent global variable.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.