iframe задаване на src="" от id

kWo_2

Registered
Напоследък забелязвам iframe-ове от типа на
<iframe id="how" width="" height=""></iframe>
където src="" липсва и пътя към към линка някак си се задава от id="how" с js, но как :?
 
<script type="text/javascript">
function iframe() {
document.getElementById("how").setAttribute("src","http://google.bg/");
}
window.onload = function(){iframe();};
</script>
<iframe id="how" width="" height="" src="#"></iframe>

:?:
 
Но по този начин ми зарежда 2 пъти страницата .. :? защо става така
 
<script type="text/javascript">
function iframe() {
document.getElementById("how").setAttribute("src","http://google.bg/");
}
$(document).ready(function() {iframe();};
</script>
<iframe id="how" width="" height="" src="#"></iframe>

:?:
 

Back
Горе