php(またはcodeigniterに固有のもの)でajax呼び出しと通常のブラウザ要求を区別する方法はありますか?php(またはcodeigniter)でajax呼び出しとブラウザ要求を区別する方法は?
これは私のjqueryのAJAX呼び出しです:これはCodeIgniterの中に顧客のコントローラのインデックスメソッドである
$(document).ready(function() {
$('#container').load('http://localhost/index.php/customer/');
});
:
public function index() {
//if (call == 'ajax request')
// do this if it's an ajax request;
//else
// do that if user directly type the link in the address bar;
$this->load->view('customer/listview');
}
任意の助けをいただければ幸いです。ありがとう。
うわー、それは動作します。入力クラスを完全には読まなかったと思います。どうもありがとうございます。 – dqiu