Jendela frame properti
Definisi dan Penggunaan
properti frame mengembalikan bingkai jendela semua bernama.
Koleksi ini adalah array dari objek Window, masing-masing berisi objek Window pada bingkai jendela atau <iframe>. Jumlah elemen dalam array untuk menyimpan frame frames.length properti [] terkandung. Perhatikan bahwa bingkai frame [] array juga mungkin termasuk kerangka acuan, juga memiliki frame sendiri [] array mereka.
Tip: Gunakan frames.length untuk mendapatkan jumlah frame.
tatabahasa
window.frames
Dukungan Browser
Semua browser utama mendukung properti frame
contoh
contoh
Cari jumlah semua frame pada halaman, dan kemudian memodifikasi elemen bingkai src atribut "w3cschool.cc":
<html>
<body>
<iframe src="http://microsoft.com"></iframe>
<iframe src="http://google.com"></iframe>
<iframe src="http://youtube.com"></iframe>
<script>
for (var i=0; i<frames.length; i++)
{
frames[i].location="http://w3cschool.cc"
}
</script>
</body>
</html>
<body>
<iframe src="http://microsoft.com"></iframe>
<iframe src="http://google.com"></iframe>
<iframe src="http://youtube.com"></iframe>
<script>
for (var i=0; i<frames.length; i++)
{
frames[i].location="http://w3cschool.cc"
}
</script>
</body>
</html>
objek jendela