Skip to content

Instantly share code, notes, and snippets.

@veged
Created September 16, 2010 15:37
Show Gist options
  • Save veged/582634 to your computer and use it in GitHub Desktop.
Save veged/582634 to your computer and use it in GitHub Desktop.
WITH
function WITH(obj, parent) {
return function W(k, v, a) {
return (a = arguments.length) ?
(a - 1 ? (obj[k] = v, W) : WITH(obj[k], W)) :
parent || obj;
}
}
document.body.appendChild(
WITH(document.createElement('iframe'))
('scrolling', 'no')
('frameborder', 0)
('onload', function() { /* BLA */})
('src', '//bla.bla')
('style')
('position', 'absolute')
('left', 0)
('top', 0)
('overflow', 'none')
('width', '100%')
('height', '100px')
('marginTop', '-160px')
('border', 'none')
()
());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment