Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //The following code calls the function that exists in the main window from the iframe window
- if(typeof parent.window !== 'undefined' && typeof parent.window.functionName === 'function'){
- parent.window.functionName(); //Call the function only if it exists
- }
- //The following code calls the function that exists in the iframe window from the main window
- if(typeof document.frames['iframeName'] !== 'undefined' && typeof document.frames['iframeName'].functionName === 'function'){
- document.frames['iframeName'].functionName(); //Call the function available in the iframe window from the parent window.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement