From 1a2164a7bb412580b4df988b597ee19f5ddc2a71 Mon Sep 17 00:00:00 2001 From: Alexander Wunschik Date: Fri, 16 Aug 2013 23:30:04 +0200 Subject: [PATCH] changed the fixes history call and implemented a 2 second delay; hope this fixes #32 --- js/script.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/js/script.js b/js/script.js index 200f6a2..b2249be 100644 --- a/js/script.js +++ b/js/script.js @@ -160,17 +160,18 @@ $('#accessBtn').click(function(e) { var $btn = $(this); $btn.empty().html(''); - //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 :-(");