首先这是代码
<div id="channelmiddle" class="middle-content alignleft">
<script type="text/javascript">
function changechannel(ch)
{
var url = "ch"+ch+".html";
document.getElementById("channelchange").src = "ch"+ch+".html";
}
</script>
<center>
<button class="button_static" onclick="changechannel(1)">Channel 1</button>
<button class="button_static" onclick="changechannel(2)">Channel 2</button>
<button class="button_static" onclick="changechannel(3)">Channel 3</button>
<button class="button_static" onclick="changechannel(4)">Channel 4</button>
<button class="button_static" onclick="changechannel(5)">Channel 5</button>
</center>
<iframe id="channelchange" src="ch1.html" onLoad="alert('123')" width="500" height="400" scrolling="no"></iframe>
</div>
在此页面上,每当我单击按钮时,它都会重定向到主页。我不知道为什么。有人能帮我吗?您需要有关代码的更多信息吗?