Skip to content

Instantly share code, notes, and snippets.

@parkerproject
Created April 30, 2015 20:24
Show Gist options
  • Select an option

  • Save parkerproject/ce81946a9f4828f5a9d9 to your computer and use it in GitHub Desktop.

Select an option

Save parkerproject/ce81946a9f4828f5a9d9 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/mosofujeve
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var _fragment = document.createDocumentFragment();
var _contents = _fragment.appendChild(document.createElement('noscript'));
var _iframe = document.createElement('iframe');
var _src = document.createAttribute('src');
var _height = document.createAttribute('height');
var _width = document.createAttribute('width');
var _style = document.createAttribute('style');
_src.nodeValue = '//www.googletagmanager.com/ns.html?id=GTM-NTQLMT';
_height.nodeValue = 0;
_width.nodeValue = 0;
_style.nodeValue = 'display:none;visibility:hidden';
_iframe.setAttributeNode(_src);
_iframe.setAttributeNode(_height);
_iframe.setAttributeNode(_width);
_iframe.setAttributeNode(_style);
_contents.appendChild(_iframe);
console.log(_fragment);
//var _body = document.getElementById("body");
document.body.insertBefore(_iframe, document.body.firstChild);
</script>
<script id="jsbin-source-javascript" type="text/javascript">var _fragment = document.createDocumentFragment();
var _contents = _fragment.appendChild(document.createElement('noscript'));
var _iframe = document.createElement('iframe');
var _src = document.createAttribute('src');
var _height = document.createAttribute('height');
var _width = document.createAttribute('width');
var _style = document.createAttribute('style');
_src.nodeValue = '//www.googletagmanager.com/ns.html?id=GTM-NTQLMT';
_height.nodeValue = 0;
_width.nodeValue = 0;
_style.nodeValue = 'display:none;visibility:hidden';
_iframe.setAttributeNode(_src);
_iframe.setAttributeNode(_height);
_iframe.setAttributeNode(_width);
_iframe.setAttributeNode(_style);
_contents.appendChild(_iframe);
console.log(_fragment);
//var _body = document.getElementById("body");
document.body.insertBefore(_iframe, document.body.firstChild);</script></body>
</html>
var _fragment = document.createDocumentFragment();
var _contents = _fragment.appendChild(document.createElement('noscript'));
var _iframe = document.createElement('iframe');
var _src = document.createAttribute('src');
var _height = document.createAttribute('height');
var _width = document.createAttribute('width');
var _style = document.createAttribute('style');
_src.nodeValue = '//www.googletagmanager.com/ns.html?id=GTM-NTQLMT';
_height.nodeValue = 0;
_width.nodeValue = 0;
_style.nodeValue = 'display:none;visibility:hidden';
_iframe.setAttributeNode(_src);
_iframe.setAttributeNode(_height);
_iframe.setAttributeNode(_width);
_iframe.setAttributeNode(_style);
_contents.appendChild(_iframe);
console.log(_fragment);
//var _body = document.getElementById("body");
document.body.insertBefore(_iframe, document.body.firstChild);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment