We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c70ffe2 commit dc4ab30Copy full SHA for dc4ab30
jquery.pjax.js
@@ -556,6 +556,20 @@ function uniqueId() {
556
}
557
558
function cloneContents(container) {
559
+ // Preserve textarea values
560
+ var textarea = findAll(container, "textarea")
561
+ textarea.text(function(i, text){return textarea[i].value})
562
+
563
+ // Preserve select values
564
+ findAll(container, "select").each(function(i, elem){
565
+ elem = $(elem);
566
+ var values = $(elem).val();
567
+ elem.find('option[selected]').attr('selected', false);
568
+ elem.find('option').filter(function(){
569
+ return ($.inArray(this.value, values) !== -1);
570
+ }).attr('selected', true);
571
+ })
572
573
var cloned = container.clone()
574
// Unmark script tags as already being eval'd so they can get executed again
575
// when restored from cache. HAXX: Uses jQuery internal method.
0 commit comments