Skip to content

Instantly share code, notes, and snippets.

@jrbruce
Created February 15, 2011 19:06
Show Gist options
  • Save jrbruce/828022 to your computer and use it in GitHub Desktop.
Save jrbruce/828022 to your computer and use it in GitHub Desktop.
This is the client's page that will embed our signup iframe.
// Need to grab hash from page here
// Append hash to iFrame src url
// Set path to the iframe file
var filePath = 'http://www.google.com';
// Setup the iframe target
var iframe='<iframe id="frame" name="widget" src ="#" width="100%" height="1" marginheight="0" marginwidth="0" frameborder="no" scrolling="no"></iframe>';
// Write the iframe to the page
document.write(iframe);
var myIframe = parent.document.getElementById("frame");
// Setup the width and height
myIframe.height = 350;
myIframe.width = 960;
myIframe.src = filePath;
// set the style of the iframe
myIframe.style.border = "1px solid #999";
myIframe.style.padding = "8px";
<html>
<head><title>Awesome Test</title></head>
<body>
<!-- one line of JavaScript is all that is needed to generate the iframe. -->
<script language="JavaScript" src="js_code.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment