Q:

How can I add one more select option to jQuery UI combobox with remote source on client side?

Here is the code of jquery ui combobox with remote source. I need to add one more select option ('any city') to that combobox on client side (with javascript/jquery usage). How can I do it?

A:

I would probably insert the value in the success callback when you get the data beck from the search URL. Something like this (I've trimmed out some extraneous code):
/* ... */
source: function(request, response) {
    $.ajax({
        url: self.options.source,
        type: "POST",
        /* snip */
        success: function(data) {
            data.geonames.unshift({
              name: 'Any City',
              countryName: '...'
            });
            // the rest of the success callback as before...
        },
        /* snip */
    });
},
/* ... */

The unshift method of Javascript arrays inserts a value into the front of the array.

