title: iFrame doesn't post back with postMessage
body: <p>I'm building a modal filled with iFrame content. Inside that modal I have a dropbox upload function. What I try to do is when somebody succesfully uploads an image and click the "close" button that the info is posted back to the original site. Then I can show a nice button with "image uploaded" or something. 
  Problem is that i constantly get an error saying <code>SyntaxError: An invalid or illegal string was specified..... window.parent.postMessage('close', url);</code></p>
  
  <p>The url for the iFrame:</p>
  
  <pre><code>http://www.webshop.com/dropboxupload/?id=1042013-72374&amp;amp;url=http://www.website.com/&amp;amp;place=0#
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>function getUrlVars() {
  var vars = {};
  var parts = window.location.href.replace(/[?&amp;amp;]+([^=&amp;amp;]+)=([^&amp;amp;]*)/gi, function(m,key,value){vars[key] = value; }); 
  return vars;
  }
  
  function close_parent(){ 
      var url = getUrlVars()["url"]; 
      //console.log(url);
      window.parent.postMessage('close', url);
  } 
  </code></pre>
  
  <p>When I use console.log in the code I get just "htt" without the rest of the url. </p>
  
  <p>The Html for the closing button:</p>
  
  <pre><code>&lt;a class="close uploadbutton" onclick="javascript:close_parent();" href="#"&gt;Voltooien&lt;/a&gt;
  </code></pre>
  
  <p>The code when returning to the original site:</p>
  
  <pre><code> var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
                  var eventer = window[eventMethod];
                  var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
                  var url = window.location.href;
  
                  eventer(messageEvent,function(e) {
                    if(e.data == 'close'){
                      up_popover_hide();
                      var urlIframe = $('iframe#upload').attr("src");
                      var indexPlace = getUrlVars(urlIframe )["place"];
                      var idUpload = getUrlVars(urlIframe )["id"];
                      $('.placeholder.index_'+indexPlace+' .upload_'+idUpload).html('File uploaded!');
                    }else{}},false);
  </code></pre>
  
  <p>I really can't see what I'm doing wrong and don't understand why I just get "htt" instead of the full url.</p>
  
  <p>Any help greatly appreciated!</p>