<script type="text/javascript">
$.ajax({
type: "GET",
async: false,
url:"{SITE_URL}index.php?c=api&m=html&name=yy&format=jsonp",
dataType: "jsonp",
success: function(json){
$("#js-headerRight").html(json.html);
},
error: function(){ }
});
</script>官方是指定了模板頁面,我這里想做個搜索,然后實時傳送KEY過來通過AJAX獲取內(nèi)容,實時輸入實時變化#js-headerRight
試試這種思路,url傳參數(shù)過去
{SITE_URL}index.php?c=api&m=html&name=yy&format=jsonp&參數(shù)=參數(shù)值然后在ajax模板里面接收這個參數(shù)并查詢
【資陽胖子】1樓 我想問問,POSCMS 里有 GET 參數(shù)嗎?手冊沒找到,我倒是也想到這個方法了
解決了,但是我要怎么根據(jù)關鍵字搜索出內(nèi)容呢?官方的搜索是一個ID
【資陽胖子】1樓
LIKE_title=關鍵字
{list action=module module=products field=title,url,updatetime order=updatetime num=10 LIKE_title=%$skey%}
{/list}