Hi community, nun wollte ich eine "Please wait while loading..."-Zwischenseite einrichten, so bin ich vorgegangen, das Dokument:
Und der Inhalt meiner loading.js:
Der dazugehörige style:
Nun sendet das Formular die Daten an sich selbst, was für den js-Teil nicht relevant ist (trotzdem mal erwähnt).
Nun wenn ich die Form "submitte", lädt die Seite ja kurz und genau dann sollten halt die js-Evente greifen oder?
Auch sehe ich in der Konsole nichts(bevor die Seite neu lädt meine ich).
Kann mir da jmd weiterhelfen?
Gruß
PHP-Code:
<?php
include('check_formular.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>title</title>
<script type="text/javascript" src="javascript/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="javascript/loading.js"></script>
<link rel="stylesheet" href="style/reset.css" />
<link rel="stylesheet" href="style/style.css" />
</head>
<body>
<img id="loading_icon" style="display:none;" src="img/loading_icon.gif" />
<div id="loading_background" style="display:none;"></div>
<form action="" method="POST" id="reg_form">
// Das komplette Formular => Affenformular
</form>
</body>
</html>
PHP-Code:
$(document).ajaxStart(function() {
console.log("START");
$("#loading_icon").show();
$("#loading_background").show();
}).ajaxStop(function() {
console.log("END");
$("#loading_icon").hide('slow');
$("#loading_background").hide('slow');
});
PHP-Code:
#loading_icon {
left: 700px;
position: fixed;
right: auto;
top: 325px;
z-index: 50000 !important;
}
#loading_background {
background: black;
bottom: 0;
left: 0;
opacity: 0.6;
position: fixed;
right: 0;
top: 0;
z-index: 49999 !important;
}
Nun wenn ich die Form "submitte", lädt die Seite ja kurz und genau dann sollten halt die js-Evente greifen oder?
Auch sehe ich in der Konsole nichts(bevor die Seite neu lädt meine ich).
Kann mir da jmd weiterhelfen?
Gruß
Kommentar