function getTime()
{
var date = new Array(
<?php
$date1 = date("Y-m-d, H:i");
echo "new Array(\"".$date1."\")";
?>);
//document.write(date[0]);
return date[0];
}
function showmychart() {
max_time = getTime();
min_time = getMintime(max_time);
//document.write(max_time);
//delete myChart;
var c_channel = channel;
myChart = new Drawchart(max_time, min_time,c_channel);
myChart.showChart();
}
function changeSBS(){
channel = 'sbs';
showmychart();
}
function changeKBS2(){
channel = 'kbs2';
showmychart();
}
</script>
</head>
<body>
<center>
<div id = "header">
</div>
<div id="middle">
<input type = "button" id ="before" onclick="showBeforeChart();" value = "Before">
<object id="chart"></object>
<script class="code" id="Drawchart" type="text/javascript">showmychart();</script>
<input type = "button" id ="after" onclick="showAfterChart();" value = "After">
</div>
<div id = "channel_position">
<input type = "button" id ="before" onclick="changeSBS();" value = "aaa">
<input type = "button" id ="before" onclick="changeKBS2();" value = "bbb">
在这段代码中,当我单击 aaa 按钮或 bbb 按钮时,我想使用函数 getTime() 更新函数 shomychart() 中的 max_time。现在,当我单击按钮 aaa 并且 bbb 它没有更新时,我认为它没有调用 getTime() 函数或在 getTime() 函数中不起作用......我该如何解决这个问题? ??