Ich habe hoch und niedrig suchen und ohne Lösung aufgetaucht.JQUERY: IE9 ignorieren PreventDefault
Ich möchte, dass meine Submit-Funktion die Aktion verarbeitet, wenn der Benutzer auf die Schaltfläche zum Senden klickt und die Standardaktion außer Kraft setzt.Firefox und Chrome funktionieren einwandfrei, aber in IE9 wird durch Klicken auf die Schaltfläche die Seite auf Standard gesetzt. aspx (Ich verwende ASP.NET und führe diesen Code auf localhost aus).
/////////////////Submit Function/////////////
$('#ARBB').submit(function (event) {
//e.cancelBubble is supported by IE - this will kill the bubbling process.
event.cancelBubble = true;
event.returnValue = false;
//e.stopPropagation works only in Firefox.
if (event.stopPropagation) {
event.stopPropagation();
event.preventDefault();
}
// initialize validator for a bunch of input fields
var inputs = $("#Contact :input").validator();
// perform validation programmatically
//inputs.data("validator").checkValidity();
$('#conf').load("/Confirmation.aspx");
$.blockUI({ css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
}
});
setTimeout($.unblockUI, 500);
$("#accordion").accordion("enable");
$("#accordion").accordion("option", "active", 3);
$("#CheckMark3").fadeIn("fast");
$('html, body').animate({
scrollTop: $("#Section3").offset().top
}, 500);
});
///////////////////////////////////////////
EDIT/UPDATE
IE9 den Fehler wirft, wenn die Last-Funktion aufgerufen wird.
$ ('# conf') Last ("/ Confirmation.aspx");
Der Fehler ist:
script5: Zugriff verweigert wird.
jquery-1.6.2.js, Linie 6244 Zeichen 2
"//e.stopPropagation funktioniert nur in Firefox." Sag was? Ich weiß nicht, woher du deine Informationen bekommst, aber es ist falsch. – PeeHaa