私は私の中にこのコードを持っていますbootstrap.php
Route::set('get_locations','ajax/locations.json')
->defaults(array(
'controller' => 'ajax',
'action' => 'locations',
));
そして、これは私のコードですAjax.php
public function locations(){
echo json_encode(array("success" => true));
}
以下のようなajax呼び出しを行うと、うまくいかないようです
$(document).ready(function(){
$.ajax({
url: "ajax/locations.json",
type: "GET",
dataType: "json",
success: function(result){
if(result["success"]=='true'){
alert('success');
}
}
});
});
リクエストは常に返されます404 Not Found
どんな助けでも構いません。
ありがとうございました。