The squirrels are blogging


posted in JavaScript, 02.09.09 17:25


Get google maps coordinates

Ever wondered how to get the coordinates out of a GoogleMaps applet? It's pretty simple. Just enter this in your location bar.

javascript:alert(gApplication.getMap().getCenter());

It will open a dialog with the map's center's latitude and longitude.


posted in JavaScript, 11.08.09 13:54


Dynamic height on cross domain iframes

An iframe is normally fixed in height. One could resize it via JavaScript to fit its content.


  var contentHeight = docment.getElementById('my-iframe').contentWindow.body.scrollHeight();
  docment.getElementById('my-iframe').style.height = contentHeight + 'px';

Of course this doesn't work for crossdomain-iframes, since the parent is not allowed to acces the iframe and vice versa.

However, the iframe itself could contain another iframe pointing to the parent-host, which then is allowed to communicate with it's parent's parent (the actual page).

a.com:


b.com:


a.com/inner.js:


a.com/inner.php?height=23:

Note that the only code required to be included by the target is: