一旦執行函數click_function_ps()
,我編寫了刷新DIV容器的代碼。但我的代碼不起作用。它說:刷新DIV容器
missing ; before statement
var newHTML = "<img class="displayed" src="ganttchart.php">";
那麼,我需要在哪裏把;
?
<div class="buttons">
<a href="#" class="regular" onclick="click_function_ps(); replaceContent();">
<img src="images/opt.png" alt=""/> Run </a>
</div>
<div id="opt_container">
<table width="100%">
<tr>
<td width="100%">
<div class="scrollbar" id="chart">
<img class="displayed" src="ganttchart.php">
</div>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function replaceContent() {
var newHTML = "<img class="displayed" src="ganttchart.php">";
document.getElementById("scrollbar").innerHTML = newHTML;
}
</script>
var newHTML =''; – Ruben