Suppose I have something like this:
<html> ... <div> <iframe src="test.html" hash="r4d5f7"></iframe> <iframe src="test.html" hash="8f7x97"></iframe> <iframe src="test.html" hash="gg4v5e"></iframe> <iframe src="test.html" hash="e54f87"></iframe> </div> ... </html>
test.html is a blank page, the hash user attribute always has a different value, both pages are in the same domain for security reasons, the number and order of iframes are random.
My question is: is there a way to get from the internal page (test.html) using Javascript in my own iframe element? Say I'm on the third page of an iframe, and I need to go to its iframe element and alert () the hash value (in this case "gg4v5e").
To be more specific. If you are familiar with Firefox Firebug, he visualizes this situation as follows:
<html> ... <div> <iframe src="test.html" hash="r4d5f7"> <html> ... </html> </iframe> <iframe src="test.html" hash="8f7x97"> <html> ... </html> </iframe> <iframe src="test.html" hash="gg4v5e"> <html> ... </html> </iframe> <iframe src="test.html" hash="e54f87"> <html> ... </html> </iframe> </div> ... </html>
Is it possible to call "something" to get the parent element ( <iframe> ) when I'm with my Javascript on the <html> element on the inner page?
javascript jquery dom html iframe
Czfox
source share