所以我做了下面,看起来像它正在执行url1罚款,但url2仍然没有被应用。单独他们工作得很好,只是没有togeather。如何在同一个函数中传递多个“var url”?
<script type="text/javascript">
<!--
function Start() {
var url1 = "http://stream.xxx.net:7300/event/start";
var url2 = "http://stream.xxx.net:7301/event/start";
window.frames["ifrmInitLiveBroadcast"].location = url1;
window.frames["ifrmInitLiveBroadcast"].location = url2;
alert("Live Broadcast Started")
}
function Stop() {
var url1 = "http://stream.xxx.net:7300/event/stop";
var url2 = "http://stream.xxx.net:7301/event/stop";
window.frames["ifrmInitLiveBroadcast"].location = url1;
window.frames["ifrmInitLiveBroadcast"].location = url2;
alert("Live Broadcast Terminated")
}
//-->
</script>
下面是在同一脚本中关联的表代码,也许这里需要更改一些内容吗?
<table style="width: 400" cellspacing="1" class="style7">
<tr>
<td style="height: 50px; width: 200px; text-align: center">
<button onclick="Start()" style="height: 30">Start It</button> <br>
<iframe name="ifrmInitLiveBroadcast" id="ifrmInitLiveBroadcast" src="" width="0" height="0" scrolling="0" frameborder="0" ></iframe>
</td>
<td style="height: 50px; text-align: center; width: 200px">
<button type="button" onclick="Stop()" style="height: 30px">Stop It</button><br>
<iframe name="ifrmInitLiveBroadcast" id="ifrmInitLiveBroadcast" src="" width="0" height="0" scrolling="0" frameborder="0" ></iframe>
</td>
</tr>
</table>
您的框架看起来都具有相同的名称。 – cmbuckley