【发布时间】:2016-05-19 09:04:59
【问题描述】:
到目前为止,这是我的语义 UI API 设置:
$.fn.api.settings.api = {
'search' : '/api/search.api.php?query={value}'
};
$(document).ready(function() {
$('.searchterms input')
.api({
action : 'search',
stateContext : '.ui.input',
minCharacters : 3
});
});
我的search.api.php 触发一个mysql 查询,结果应该被加载<div id="#results">。作为模板引擎,我使用smarty,所以search.api.php 包含以下几行:
foreach($results AS $aresult) {
$smarty->display('single_result.tpl');
}
现在我的问题是:如何使用 jQuery 的 load() 来处理它?应该是这样的
$("#results").load(...???);
【问题讨论】:
-
$("#results").load(your url, {data you want to send on server});
-
当然,我知道 load() 的语法。但是我怎样才能强制它与语义 UI API 交互呢?
标签: php jquery api load semantic-ui