Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<script type="text/javascript">
<!--
var tempImage;
function showDimensions() {
var imageName = document.forms[0].elements['myFile'].value;
if (imageName != '') {
imageName = 'file:///' + escape(imageName.split('\\').join('/'));
imageName = imageName.split('%3A').join(':');
tempImage = new Image();
tempImage.onload = getDimensions;
tempImage.src = imageName + '?randParam=' + new Date().getTime();
// append a timestamp to avoid caching issues - which happen if you overwrite any image with one of different dimensions, and try to get the dimensions again
// even with cache settings to max, in both ff and ie!
}
}
function getDimensions() {
alert(tempImage.width + ' x ' + tempImage.height);
}
//-->
</script>
</head>
<body>
<form>
<input type="file" name="myFile" />
<br />
<input type="button" value="Show dimensions" onclick="showDimensions();" />
</form>
</body>
</html>