Ver código fonte

Merge pull request #692 from 4sh/master

Allow to pass a callback as ajax.url configuration parameter
Igor Vaynberg 12 anos atrás
pai
commit
b562d1a0e5
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -316,7 +316,7 @@ the specific language governing permissions and limitations under the Apache Lic
                 if( null !== handler) { handler.abort(); }
 
                 handler = transport.call(null, {
-                    url: options.url,
+                    url: ((typeof options.url === 'function')?options.url():options.url),
                     dataType: options.dataType,
                     data: data,
                     type: type,