私は次のjquery ajaxを持っています
fnc = {
ajax : function (){
$.ajax({
url: 'index.php?route=module/rows/filterView',
type: 'get',
success: function(data) {
alert(data);
}
});
}
}
これは私のイベント登録です
$(document).on('click','.loadfilter', function() {
fnc.ajax();
})
そして、これが私のコントローラーです
public function filterView() {
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/collections.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/collections.tpl';
} else {
$this->template = 'default/template/module/collections.tpl';
}
$this->render();
}
私の collections.tpl には、テスト コンテンツがあります。
しかし、リンクをクリックすると、空のアラートが表示されます。値は含まれていません。
空のアラートが表示される理由。私がここでやっている間違いは何ですか。誰でも助けることができますか