Skip to content

Instantly share code, notes, and snippets.

@gmcinnes
Created September 30, 2013 19:54
Show Gist options
  • Save gmcinnes/6769227 to your computer and use it in GitHub Desktop.
Save gmcinnes/6769227 to your computer and use it in GitHub Desktop.
Javascript for pipe helper
<script type="text/javascript">
function iframeResizePipe()
{
// What's the page height?
var height = document.body.scrollHeight;
// Going to 'pipe' the data to the parent through the helpframe..
var pipe = document.getElementById('helpframe');
// Get our current location - staging? production? local?
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
// Cachebuster a precaution here to stop browser caching interfering
pipe.src =full+'/wp-content/themes/marsdd-test/careers_helper.html?height='+height+'&cacheb='+Math.random();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment