私はフォームを持っています:
<form accept-charset="UTF-8" action="/back/pages/22?locale=fr" class="form-horizontal page-form" enctype="multipart/form-data" id="edit_page_22" method="post" target="_blank"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓">
<p><a href="#" id="no_window">Submit</a></p>
<p><a href="#" id="new_window">Submit & _blank</a></p>
</form>
そしてスクリプトが添付されています:
$(document).ready(function() {
var page_form;
page_form = {
elem: $('form.page-form'),
rand_action: function() {
var action;
action = this.elem.attr('action');
return this.elem.attr('action', action + '&count=' + Math.random() * 1000);
},
submit_blank: function() {
this.elem.attr('target', '_blank');
$('<input>').attr({
type: 'hidden',
id: 'input_new_window',
name: 'edit_redirect',
value: 'true'
}).appendTo(this.elem);
return this.elem.submit();
},
submit: function() {
this.elem.attr('target', '_self');
$('#input_new_window').remove();
return this.elem.submit();
}
};
$("#new_window").click(function(event) {
event.preventDefault();
page_form.submit_blank();
page_form.rand_action();
return page_form.submit();
});
$("#no_window").click(function(event) {
event.preventDefault();
return page_form.submit();
});
});
FFではうまくいきますが、Chromeではうまくいきません。