Clear previous cached options in jQuery chosen for new AJAX submit -


auto-populating values in jquery chosen on key press event values typed in chosen field. in first request, fine. furthur keypress event, values getting appended previous appended options. below callback code.

success: function(data) { each(data, function(index) { $(".chzn-select").append( $('<option></option>') .val(data[index]) .html(data[index])); }); $(".chzn-select").trigger("liszt:updated"); } 

is possible clear chosen optioned values before ajax call.

you configure jquery ajax requests without caching.

$(document).ready(function() {   $.ajaxsetup({ cache: false }); }); 

with this, jquery add parameter named _ on url random number , make diferent request , url server avoiding browser caching. can configure cache in $.ajax command, sample:

$.ajax({    // configs...    cache: false,    // configs... }); 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -