Skip to content

Instantly share code, notes, and snippets.

@ZauberNerd
ZauberNerd / sandbox.js
Created March 8, 2012 11:08
Run JavaScript code sandboxed by an iframe
var runInSandbox = (function () {
function extend(dest, src, arr) {
var property = null,
ext = '',
isArray = false,
key;
for (property in src) {
key = arr ? '[' + property + ']' : '["' + property + '"]';
ext += dest + key + ' = ';