Created
March 21, 2013 04:58
-
-
Save parvez/5210796 to your computer and use it in GitHub Desktop.
JavaScript + CSS based Update Check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var head = document.getElementsByTagName("head")[0]; | |
var css = document.createElement('link'); | |
css.type = 'text/css'; | |
css.rel = 'stylesheet'; | |
css.href = 'http://product.website.here/update_1.0.css?'+Date.now(); | |
// css.href = 'http://product.website.here/update_1.2.css?'+Date.now(); Uncomment for version 1.2 | |
css.media = 'screen'; | |
head.appendChild(css) | |
</script> | |
<div id="update"> | |
PRODUCT_NAME <span id="new_version"></span> is now available (you have <span style="color:#fff">1.2</span>) | |
<a href="http://product.website.here/download.php">Download</a> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#update { | |
display: block !important; | |
} | |
span#new_version:before { | |
content: "1.2"; /* Current version is 1.2 */ | |
color: white; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#update { | |
display: none !important; | |
} | |
span#new_version:before { | |
content: "1.2"; /* Current version is 1.2 */ | |
color: white; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment