【发布时间】:2015-05-21 15:55:23
【问题描述】:
我正在尝试加载此文件,该文件位于当前文件夹之外的另一个文件夹中。
更准确地说,这个文件位于
root/js/search.js
$(document).ready(function() {
$("#results").load("../functions/populateResults.php"); //initial page number to load
$(".pagination").bootpag({
total: <?php echo $pages; ?>,
page: 1,
maxVisible: 5
}).on("page", function(e, num){
e.preventDefault();
window.scrollTo(0, 0);
$("#results").prepend('<div class="loading-indication"><img src="ajax-loader.gif" /> Please wait... Loading New Courses...</div>');
$("#results").load("../functions/populateResults.php", {'page':num});
});
});
我正在尝试加载位于 root/functions/populateResults.php 的文件,我在上面看到的尝试似乎不起作用,希望能得到一些帮助。
一切顺利, 乔纳森·艾蒂安
【问题讨论】:
-
你的 js 文件所在的位置不相关......重要的是它使用的页面所在的位置
标签: javascript php jquery ajax file