Okay! @Miguel. I also have another alternative to make% dynamic% load the attribute <iframe/>
of the link.
It occurred to me in the thought line to replace the attribute href
for the attribute src
of name
. A little change and see the result here:
window.onclick=function() {
document.getElementById('exibir').innerHTML='';
obj = document.createElement("iframe");
obj.setAttribute("name","id");
obj.style.width = 240+"px";
obj.style.height = 180+"px";
document.getElementById('exibir').appendChild(obj);
}
<a href="http://bing.com/?cc=br" target="id">bing</a> /
<a href="http://br.ask.com" target="id">ask</a> /
<a href="http://br.search.yahoo.com" target="id">yahoo</a> /
<a href="http://google.com.br" target="id">google</a>
<hr>
<span id="exibir"></span>
Now for the <iframe/>
also created dynamically, I have completely re-scripted it to work as expected. Check out:
function abrir(URL) {
document.getElementById("exibir").innerHTML = "<embed src='"+URL+"' type='application/mplayer' nocache='0' showcontrols='false' autostart='1' width='' height=''/>";
}
<a href="http://cache28.vuclip.com/53/65/5365756905f3dbd79909b3cce52649a3/ba63207/NiceGuys_5365_w_3.3gp" onclick="abrir(this.href); return false;">clic</a>
<hr>
<span id="exibir"></span>
Please note that both results will undergo some significant or significant modification.
The rest for me was satisfactory, now I hope this doubt or function helps someone else.