How do I return 'No results'

How do I return 'No results'

This is my jQuery:
      1. $('#locality_input').autocomplete({
           source: function(request, response) {
            $.ajax({
             url: 'php/csvtoarray.php',
             dataType: 'json',
             data: {
              state: $('#state').val(),
              q: request.term
             },
             success: function(data) {
              response($.map(data, function(item) {
               return {
                label: item.locality + ', ' + item.postcode + ', ' + item.state,
                value: item.label,
                postcode: item.postcode,
                locality: item.locality
               }
              }));
             }
            })
           },
           select: function(event, ui) {  
            $('#location_postcode').val(ui.item.postcode);
            $('#location_label').val(ui.item.label);
            $('#location_locality').val(ui.item.locality);
           },
           minLength: 3
         });


























        It will return values like this:

    1. [{"postcode":"5000","locality":"ADELAIDE","state":"SA"},{"postcode":"5000","locality":"ADELAIDE BC","state":"SA"},{"postcode":"5000","locality":"HALIFAX STREET","state":"SA"},{"postcode":"5000","locality":"HUTT STREET","state":"SA"},{"postcode":"5000","locality":"RUNDLE MALL","state":"SA"},{"postcode":"5000","locality":"STATION ARCADE","state":"SA"}]
    2. If the JSON returned is [] how do I display 'No results' as a result?
      • Topic Participants

      • ricky