Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return Response()->json(array('error' => '404 car type not found'), 404);
- $('document').ready(function () {
- $('#car_type').bind('changed.bs.select', function () {
- $.ajax({
- type: 'POST',
- url:'carclass/'+$('#car_type').val(),
- dataType: 'json',
- error: function(XMLHttpRequest, textStatus, errorThrown){
- alert('status:' + XMLHttpRequest.status + ', status text: ' + XMLHttpRequest.statusText);
- },
- success: function( json ) {
- $.each(json, function(i, obj){
- $('#car_class').append($('<option>').text(obj.name).attr('value', obj.id));
- });
- $('#car_class').selectpicker('refresh');
- }
- });
- });
- });
- GET http://localhost:8000/ads/cartype/2 404 (Not Found)
- error:function (xhr, ajaxOptions, thrownError){
- if(xhr.status==404) {
- alert(thrownError);
- }
- }
- error:function (xhr, ajaxOptions, thrownError){
- if(xhr.status==404) {
- alert(thrownError);
- }
- }
Add Comment
Please, Sign In to add comment