Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

Commit

Permalink
changed the fixes history call and implemented a 2 second delay;
Browse files Browse the repository at this point in the history
hope this fixes #32
  • Loading branch information
mojoaxel committed Aug 16, 2013
1 parent f5b2586 commit 1a2164a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,18 @@ $('#accessBtn').click(function(e) {
var $btn = $(this);
$btn.empty().html('<img src="images/loading.gif" />');

//load the access-page in the background
$('#result').load('FreifunkFrankenAccess.html', function() {
console.log("Access granted!");
});

$.ajax({
type: "GET",
url: "FreifunkFrankenAccess.html",
success: function(data){
//go to the page the user originally requested
history.go(-1);
//wait for 2 seconds to give the proxy-server time to write the access rights into the database
//and than go to the page the user originally requested
setTimeout(function() {
//history.go(-1); //see bug #32
window.history.back()
}, 2000);

$('#container').fadeOut(2500);
},
error: function() {
alert("Es gab leider ein Problem :-(");
Expand Down

0 comments on commit 1a2164a

Please sign in to comment.