O
oscar.redondo
I started with Javascript one month ago and I have a doubt.
I have a table with 2 iframes and and 3 links that activate de
Tab1_OnChange code.
Unfortunatelly, after the first iframe all getElementById (as this one
shown) makes an error.
What's wrong?
Thks in advance!
<html >
<head id="tagHead"><title>
Untitled Page
</title>
</head>
<body>
<form name="form2" method="post" action="gwcTabControlEjemplo.aspx"
id="form2">
<script>
function Tab1_onChangeTab(id)
{
var x;
x=top.document.getElementById('Tab1_fraContenido_2');
alert(x.id);
}
</script>
<TABLE border="0" width="100%" height="100%" cellpadding="2"
cellspacing="0" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<TR><TD height="10px" /></TR>
<TR><td nowrap="" id="Tab1_tdPestaña_1"
style="height:20px;" class="Tab_TabDown">
<a href="javascript:Tab1_onChangeTab(1, 'http://
www.google.es')" title="aa" class="ms-toolbar">google</a></td><td
class="Tab_TabFiller"><img src="/Blank.gif" width="3px" /></td>
<td nowrap="" id="Tab1_tdPestaña_2" style="height:20px;"
class="Tab_TabDown">
<a href="javascript:Tab1_onChangeTab(2, 'http://
www.fib.upc.es')" title="aa" class="ms-toolbar">fib</a></td><td
class="Tab_TabFiller"><img src="/Blank.gif" width="3px" /></td>
<td nowrap="" id="Tab1_tdPestaña_3" style="height:20px;"
class="Tab_TabDown">
<a href="javascript:Tab1_onChangeTab(3, 'http://
www.gelos.es')" title="aa" class="ms-toolbar">gelos</a></td><td
class="Tab_TabFiller"><img src="/Blank.gif" width="3px" /></td>
<TD width="100%" class="Tab_TabFiller"><img src="/Blank.gif" /></
TD></TR>
</TABLE>
<iframe src="http://www.google.es" frameborder="0" style="height:
100%;width:100%" id="Tab1_fraContenido_1"/>
<iframe src="http://www.iblnews.com" frameborder="0" style="height:
100%;width:100%" id="Tab1_fraContenido_2"/>
</body>
</html>
I have a table with 2 iframes and and 3 links that activate de
Tab1_OnChange code.
Unfortunatelly, after the first iframe all getElementById (as this one
shown) makes an error.
What's wrong?
Thks in advance!
<html >
<head id="tagHead"><title>
Untitled Page
</title>
</head>
<body>
<form name="form2" method="post" action="gwcTabControlEjemplo.aspx"
id="form2">
<script>
function Tab1_onChangeTab(id)
{
var x;
x=top.document.getElementById('Tab1_fraContenido_2');
alert(x.id);
}
</script>
<TABLE border="0" width="100%" height="100%" cellpadding="2"
cellspacing="0" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<TR><TD height="10px" /></TR>
<TR><td nowrap="" id="Tab1_tdPestaña_1"
style="height:20px;" class="Tab_TabDown">
<a href="javascript:Tab1_onChangeTab(1, 'http://
www.google.es')" title="aa" class="ms-toolbar">google</a></td><td
class="Tab_TabFiller"><img src="/Blank.gif" width="3px" /></td>
<td nowrap="" id="Tab1_tdPestaña_2" style="height:20px;"
class="Tab_TabDown">
<a href="javascript:Tab1_onChangeTab(2, 'http://
www.fib.upc.es')" title="aa" class="ms-toolbar">fib</a></td><td
class="Tab_TabFiller"><img src="/Blank.gif" width="3px" /></td>
<td nowrap="" id="Tab1_tdPestaña_3" style="height:20px;"
class="Tab_TabDown">
<a href="javascript:Tab1_onChangeTab(3, 'http://
www.gelos.es')" title="aa" class="ms-toolbar">gelos</a></td><td
class="Tab_TabFiller"><img src="/Blank.gif" width="3px" /></td>
<TD width="100%" class="Tab_TabFiller"><img src="/Blank.gif" /></
TD></TR>
</TABLE>
<iframe src="http://www.google.es" frameborder="0" style="height:
100%;width:100%" id="Tab1_fraContenido_1"/>
<iframe src="http://www.iblnews.com" frameborder="0" style="height:
100%;width:100%" id="Tab1_fraContenido_2"/>
</body>
</html>