title: IE8 SCRIPT87: Invalid argument.
body: <p>So I have a typical annoying without explanation IE8 error. It writes "Script87:Invalid Argument".
  Here's the code:</p>
  
  <pre><code>    var loaded = false;
      function loader(wrapperId) {
          var Loader = document.createElement("div");
          var image = document.createElement("img");
          image.src = "../scripts/loader/1.gif";
  
  
          Loader.style.marginTop = ((window.innerHeight / 2) - image.height) + 5 + "px";
          //error appears right here. ^
  
          Loader.style.marginLeft = ((window.innerWidth / 2) - (image.width)) + 5 + "px";
          Loader.style.display = "block";
  
  
          Loader.id = "loader";
          Loader.appendChild(image);
          document.body.appendChild(Loader);
  
  
          var imLoading = setInterval(function () {
              if (loaded == true) {
                  var containerLoader = document.getElementById(wrapperId);
                  var loaderDivBar = document.getElementById(Loader.id);
                  loaderDivBar.innerHTML = "";
                  containerLoader.style.visibility = "visible";
                  document.body.removeChild(loaderDivBar);
                  document.body.overflow = "visible";
                  clearInterval(imLoading);
              }
          }, 50);
          //place this call behind body object.
      }
  </code></pre>
  
  <p>Now, it works beautifully in EVERYTHING BUT IE8.
  So here's the part it spits the error out on:</p>
  
  <pre><code>Loader.style.marginTop = ((window.innerHeight / 2) - image.height) + 5 + "px";
  </code></pre>