$.getJSON("https://api.github.com/repos/theinfection/screencalculator.kdapp/contents/resources/version", function(data) {
var currentVersion = decode64(data.content);
$.get('./resources/version', function(dataVersion){
var myVersion = dataVersion;
if (currentVersion > myVersion) {
$('.update').show();
}
});
});
Explanation of the code
First, I get the contents of a file on my GitHub repository called "version" (The file has "1.4.3" written in it). Then, since GitHub encodes the contents of files in base64, I decode it with another JS file. This sets the "currentVersion" variable to 1.4.3.
Next, I call the "version" file I have on my server (which has 1.4.2 written in it). That sets the "myVersion" variable to 1.4.2.
From there, I compare the two. If currentVersion is greater than myVerison, it shows the update DIV (which by default is set to "display:none;" in the CSS).
Problem
When the two variables are equal, the DIV still shows.
Question
What should I do so that this doesn't happen? How exactly should I be using the else and else if statements to accomplish what I want?
Thanks in advance!