我正在使用select2插件。我的功能类似于当用户从select2下拉列表中选择值时,将页面重定向到新页面。但是,当用户单击浏览器的后退按钮时。我观察到select2下拉列表的占位符丢失,并且最后一个值已显示为selected。谁能帮我解决这个问题。
$('#selectedSearch').select2({
containerCssClass: 'selectedUniversalSearchCss',
placeholder: "Search",
minimumInputLength: 0,
allowClear: true,
ajax: {
//How long the user has to pause their typing before sending the next request
quietMillis: 150,
//The url of the json service
url: SearchURL,
dataType: 'jsonp',
//Our search term and what page we are on
data: function(term, page) {
return {};
},
results: function(data, page) {}
}
});