【发布时间】:2011-11-14 23:58:01
【问题描述】:
我有一个脚本用来加载一些内容:
<script>
$(".link_image").click(ajax_request);
function ajax_request() {
$('#placeholder').load("../test.php?id=1234556");
}
</script>
这会将 test.php 加载到我的 div 中。但是如果我想加载test.php 中的函数怎么办:
get_title();
有什么想法吗?
谢谢
【问题讨论】:
-
如果我正确理解您的问题,您是要从 Javascript 加载 PHP 函数还是从 test.php 生成的 Javascript 函数?
-
嗯,我不确定你的意思;为什么不直接向 test.php 发出请求,返回调用 get_title() 函数的结果?