Laravel 4 如何使用ajax(get)设置最大执行时间
当我检索大量数据时,会出现错误“500 Internal Server error”。当我选择一个只有10个城市的国家时,它会起作用,但当我选择一个有10万个城市的国家时,就会出现错误。有什么解决办法吗 我的剧本Laravel 4 如何使用ajax(get)设置最大执行时间,laravel-4,Laravel 4,当我检索大量数据时,会出现错误“500 Internal Server error”。当我选择一个只有10个城市的国家时,它会起作用,但当我选择一个有10万个城市的国家时,就会出现错误。有什么解决办法吗 我的剧本 $('#country_id').on('change',function(e){ console.log(e); var cat_id = e.target.value; var e = document.getElementById("country_id");
$('#country_id').on('change',function(e){
console.log(e);
var cat_id = e.target.value;
var e = document.getElementById("country_id");
var str = e.options[e.selectedIndex].value;
document.getElementById('txt').value = str;
$.get('/public/countrycity/ajax-sub?cat_id=' + cat_id, function(data){
$('#state').empty();
$.each(data, function(category, subcatObj){
$('#state').append('<option value="'+subcatObj.id+'">'+subcatObj.FULL_NAME_ND+'</option>');
});
});
});
$('#state').on('change',function(e){
console.log(e);
var e = document.getElementById("state");
var strs = e.options[e.selectedIndex].value;
document.getElementById('txts').value = strs;
});
请发布您尝试过的代码。这是代码@chxzy
public function getCountry()
{
$countries = Country::all();
$cat_id = Input::get('cat_id');
$cities = City::where('id', '=', $cat_id)->get();
return View::make('countrycity.countrycity')
->with('countries',$countries)
->with('cities',$cities)
->with('title', 'Ajax');
}
public function getCity()
{
$cat_id = Input::get('cat_id');
$cities = City::where('CC_FIPS', '=', $cat_id)->get();
return Response::json($cities);
}