Skip to content

Commit

Permalink
Making loginResponse and its AJAX call global to fix a bug in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
sukritchhabra committed Jan 20, 2016
1 parent b1f7fbb commit 1dffdbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
25 changes: 13 additions & 12 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
/*jslint node: true*/
/*global $, jQuery, alert*/

var loginResponse;
/* AJAX request to check if user is logged in or not */
$.ajax({
url: "php/social-media.php?query=get_homepage_response",
type: "GET",
async: false,
success: function (response) {
// console.log(response);
loginResponse = JSON.parse(response);
// console.log(loginResponse);
}
});

$(document).ready(function() {

var loginResponse;
/* AJAX request to check if user is logged in or not */
$.ajax({
url: "php/social-media.php?query=get_homepage_response",
type: "GET",
async: false,
success: function (response) {
// console.log(response);
loginResponse = JSON.parse(response);
// console.log(loginResponse);
}
});

var loggedIn = loginResponse.loggedIn;
var fb_login_url = loginResponse.fb_login_url;
Expand Down
Loading

0 comments on commit 1dffdbe

Please sign in to comment.