2014-03-29

get image dimensions in JavaScript

var img = new Image();
img.src = "pathToFile";
width = img.width;
height = img.height;

Change body background color/image using JavaScript

   document.body.style.backgroundColor = '#000';
   document.body.style.backgroundImage = 'PathToImage';