Sep 2, 2013 #1 peterpann Programmer Joined Jun 19, 2007 Messages 63 Location GB In Chrome what is the syntax to call parent DOM properties from a child in an iframe ? parent.document.getElementById("divparent").scrollWidth etc works in IE8, FX, Opera, Safari but not in Chrome.
In Chrome what is the syntax to call parent DOM properties from a child in an iframe ? parent.document.getElementById("divparent").scrollWidth etc works in IE8, FX, Opera, Safari but not in Chrome.
Sep 2, 2013 #2 1DMF Programmer Joined Jan 18, 2005 Messages 8,795 Location GB What's the source code of the page with the iframe? "In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you." "If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!" Free Dance Music Downloads Upvote 0 Downvote
What's the source code of the page with the iframe? "In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you." "If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!" Free Dance Music Downloads
Sep 2, 2013 Thread starter #3 peterpann Programmer Joined Jun 19, 2007 Messages 63 Location GB code at http://cambridge.atspace.co.uk/2013/flora/testparent.htm <html> <head> <title>testparent.htm</title> </head> <body> <span id="storescreenheight" style="display:none;"></span> <br /> <iframe src="testchild.htm" height="400px"></iframe> <script type="text/javascript"> var sh = 222; document.getElementById("storescreenheight").innerHTML = sh; </script> </body> </html> <html> <head> <title>testchild.htm</title> </head> <body><a href="javascript:alert('1 ' + parent.document.getElementById('storescreenheight').innerHTML)"> parent.document.getElementById</a> </body> </html> Upvote 0 Downvote
code at http://cambridge.atspace.co.uk/2013/flora/testparent.htm <html> <head> <title>testparent.htm</title> </head> <body> <span id="storescreenheight" style="display:none;"></span> <br /> <iframe src="testchild.htm" height="400px"></iframe> <script type="text/javascript"> var sh = 222; document.getElementById("storescreenheight").innerHTML = sh; </script> </body> </html> <html> <head> <title>testchild.htm</title> </head> <body><a href="javascript:alert('1 ' + parent.document.getElementById('storescreenheight').innerHTML)"> parent.document.getElementById</a> </body> </html>
Sep 2, 2013 #4 jpadie Technical User Joined Nov 24, 2003 Messages 10,094 Location FR is it not just window.document.... Upvote 0 Downvote
Sep 2, 2013 #5 1DMF Programmer Joined Jan 18, 2005 Messages 8,795 Location GB What version of Chrome are you using , the test is showing 1 222 in Chrome for me? as it does in FireFox and IE "In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you." "If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!" Free Dance Music Downloads Upvote 0 Downvote
What version of Chrome are you using , the test is showing 1 222 in Chrome for me? as it does in FireFox and IE "In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you." "If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!" Free Dance Music Downloads