请参阅下面的代码。目标如下。当用户按下按钮时,应执行功能main.php
。一旦完成,DIV opt_container
的内容应通过运行功能ganttchart.php
填写。确实我不知道如何:填充DIV容器
- 执行
ganttchart.php
之后main.php
之后。从form
运行main.php
。
由于我是PHP新手,任何建议都会对我很有帮助。
<div id="fragment-2">
<table width="100%">
<tr>
<td width="100%">
<form name="optform" method="post" action="">
<div class="buttons">
<a href="" class="regular" onclick="click_function();return false;">
<img src="images/opt.png" alt=""/> Run optimizaton
</a>
</div>
</form>
</td>
</tr>
</table>
</div>
<div id="opt_container">
</div>
<script language="javascript">
function click_function() {
$('#opt_container').load('optim/mainOptim.php');
}
</script>
请问您可以发布一些网页链接的例子吗? –
http://www.howtoplaza.com/how-to-make-ajax-calls-with-jquery http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make- ajax-calls-with-jquery/ 并查看google的其他结果:https://www.google.pl/search?sourceid=chrome&client=ubuntu&channel=cs&ie=UTF-8&q=how+to+make+ajax+call + with + jquery – Zefiryn
请查看更新的主题。我期待'main.php'的内容在DIV opt_container中显示,尽管它不能以这种方式工作。什么可能是错的? –